Fixed overlay example to work with restructured GeoLayers.

This commit is contained in:
2019-11-05 11:23:18 +01:00
parent 87727d28b9
commit 0a30712e31
7 changed files with 17 additions and 22 deletions
+8 -10
View File
@@ -17809,7 +17809,6 @@
* @param {ScatterEvent}[e] - Contains informations on how the element was transformed.
*/
transformed(e) {
console.log(this.name);
this.onTransform.call(this, e);
}
@@ -18023,7 +18022,6 @@
y: frame.height / 2
};
console.log(frame);
frame.center = {
x: frame.x + frame.localCenter.x,
y: frame.y + frame.localCenter.y
@@ -18574,7 +18572,6 @@
get zoomFactor() {
let factor = this.baseZoomHeight / this.sprite.texture.height;
console.log(factor);
return factor
}
}
@@ -18611,7 +18608,6 @@
}
transformed(map) {
console.log('MAPVIEW RECEIVED TRANSFORM');
this.updateZoom(map);
this.updateFocusPoint(map);
}
@@ -18634,7 +18630,6 @@
if (map instanceof DeepZoomMap) this._zoom = map.floatingLevelForScale(map.image.scatter.scale);
else {
this._zoom = map.zoom;
console.warn('Zoom is not yet correctly implemented in this Map type: ' + map);
}
}
@@ -19681,6 +19676,10 @@
}
}
addChild(element) {
this.displayObject.addChild(element);
}
/**
* Adapts to a map. If the maplayer should adapt to the parent maplayer,
* no parameter must be specified.
@@ -19888,8 +19887,10 @@
this.adapt();
this.changeHandler.call(this, map, oldMap);
this.map.onTransform.add(this.transformed.bind(this));
//Call transform one time manually.
this.transformed();
this.map.onTransform.add(this.transformed.bind(this));
} else {
console.error("Could not set map, it's not of type GeoMap.", map);
}
@@ -20757,7 +20758,6 @@
}
this.mapList = new MapList(opts.startmap ? opts.startmap : null, opts.maps ? opts.maps : {});
console.log(this.mapList);
this._setupKeyboardUtils();
}
@@ -20910,7 +20910,6 @@
// }
// })
console.log(this.map);
this.map.onTransform.add(this.transformed.bind(this));
this.transformed();
@@ -20920,7 +20919,6 @@
const parent = this.ui.parent;
parent.removeChild(this.ui);
parent.addChild(this.ui);
console.log('BRING TO FRONT!');
}
}
@@ -21755,7 +21753,7 @@
adjustItems = null
} = {}) {
const name = this.name[0].toUpperCase() + this.name.slice(1).toLowerCase() + ' Overlay';
let geoLayer = new GeoLayer({ name });
let geoLayer = new GeoLayer(new PIXI.Container(), { name });
if (this.rescale) geoLayer.rescale = this.rescale;
this.items.forEach(item => {
if (!excludeItems(item)) {