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
+7 -1
View File
@@ -41,6 +41,10 @@ export class GeoLayer {
}
}
addChild(element) {
this.displayObject.addChild(element)
}
/**
* Adapts to a map. If the maplayer should adapt to the parent maplayer,
* no parameter must be specified.
@@ -248,8 +252,10 @@ export class MapLayer extends GeoLayer {
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)
}