Modified scatter to get access to the Resize event.

This commit is contained in:
2019-11-28 13:36:00 +01:00
parent 5305561619
commit f3fed535d8
6 changed files with 66 additions and 44 deletions
+8 -6
View File
@@ -264,12 +264,10 @@ export class MapLayer extends GeoLayer {
})
}
// placeLayer(layer) {
// super.placeLayer(layer)
// if (layer instanceof GeoLayer && this.map) {
// layer.adapt(this.map)
// }
// }
focus(coordinates, zoom) {
this.mapview.updateFocusPoint(this.map)
}
transformed(e) {
this.mapview.transformed(this.map)
@@ -401,6 +399,10 @@ export class MapLayer extends GeoLayer {
}*/
}
refocus() {
this.mapview.apply(this.map)
}
get map() {
return this.mapList.map
}
+11 -1
View File
@@ -267,10 +267,20 @@ export class SubmapScatter extends DisplayObjectScatter {
maxScale: 1,
startScale: 1,
overdoScaling: 1,
scalable: false
scalable: false,
resizable: true
})
super(displayObject, renderer, opts)
console.log('onResize', opts.onResize)
this.onResize = opts.onResize
}
gesture(interaction) {
super.gesture(interaction)
if (this.onResize) this.onResize(interaction)
}
get width() {
+3
View File
@@ -276,6 +276,7 @@ export class DisplayObjectScatter extends AbstractScatter {
rotation = null,
overdoScaling = 1.5,
onTransform = null,
onResize,
onThrowFinished = null
} = {}
) {
@@ -301,6 +302,7 @@ export class DisplayObjectScatter extends AbstractScatter {
rotation,
onTransform
})
this.onResize = onResize
this.displayObject = displayObject
this.displayObject.scatter = this
this.renderer = renderer
@@ -313,6 +315,7 @@ export class DisplayObjectScatter extends AbstractScatter {
if (y != null) this.y = y
}
getWorldScatter() {
return this
}
+1 -1
View File
@@ -351,7 +351,6 @@ export class AbstractScatter extends Throwable {
}
close() {
console.log('SCATTER WAS CLOSED!')
this._callCloseCallbacks()
this._removeCallbacks()
this._removeSelfFromScatterContainer()
@@ -377,6 +376,7 @@ export class AbstractScatter extends Throwable {
gesture(interaction) {
let delta = interaction.delta()
if (delta != null) {
this.addVelocity(delta)
let rotate = delta.rotate