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:
@@ -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) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user