Added the maps-module to the iwmlib.

Migrated a  ot of the content from the tuesch to the iwmlib.
This is before the decoupeling of the layers.
This commit is contained in:
2019-11-04 10:59:08 +01:00
parent e2ea89cc0b
commit 86b23f4e6f
121 changed files with 12779 additions and 40 deletions
+43
View File
@@ -0,0 +1,43 @@
/**
* A projection determines how a geographical card has to
* be interpreted to map coordinate to pixels.
*
* Most used transformation is the mercator projection,
* which projects a sphere on a cylinder.
*
* @abstract
*/
export default class Projection {
/**
* Transforms a coordinate to a normalized position on the map.
*
* @param {*} coords
* @memberof Projection
*/
forward(coords) {
console.error('You must override the forward function in ' + this.name + '.')
}
/**
* Transforms a normalized point on the map to a coordinate.
*
* @param {*} point
* @memberof Projection
*/
backward(point) {
console.error('You must override the backward fuction in ' + this.name + '.')
}
toString() {
return 'Projection (abstract)'
}
get name() {
return this.toString()
}
get maxViewport() {
return { min: new PIXI.Point(-90, -180), max: new PIXI.Point(90, 180) }
}
}