Ongoing cleanup and refactoring of maps.

This commit is contained in:
2019-11-25 18:04:11 +01:00
parent 88048f14ec
commit 5305561619
16 changed files with 462 additions and 158 deletions
+21 -7
View File
@@ -88,18 +88,32 @@ export default class MapApp extends PIXIApp {
this._setupKeyboardUtils()
}
/**
* Log boundaries for a shown map.
* This is for development purposes only, if you want
* to find the boundaries of a shown map.
*
* @memberof MapApp
*/
logMapBoundaries() {
let map = this.mapLayer.map
let boundaries = {
min: this.mapLayer.mapview.coordinatesFromWindowPoint(map, { x: 0, y: 0 }),
max: this.mapLayer.mapview.coordinatesFromWindowPoint(map, { x: 0, y: 0 })
}
console.log(JSON.stringify(boundaries))
}
_setupMapLayer() {
this.mapContainer = new PIXI.Container()
console.log(this.mapList)
this.mapLayer = new MapLayer(this.mapList, this.scene, this.mapContainer, {
name: 'Map Layer',
name: 'Root Map Layer',
focus: this.focus,
zoom: this.zoom
zoom: this.zoom,
onChange: this._mapChanged.bind(this)
})
this.mapLayer.changeHandler.add(this._mapChanged.bind(this))
if (this.mapList.map) this.mapLayer.changeMap(this.mapList.map)
}
setup() {