Transformation
Transformation is the class converting between projected coordinates and the base 2D point system, used to map the map's (usually geographical) coordinates to 2D points. It inherits from no base class, and defines the affine mapping through a 4-number matrix [a, b, c, d].
js
import { Transformation } from "maptalks";
// Usage example
const t = new Transformation([1, -1, -20037508.34, 20037508.34]);
const point = t.transform(coordinate, 1, pointOut);Constructor
js
new Transformation(matrix)Parameters:
matrix— A[a, b, c, d]array, whereais the X-axis direction scale (1means right is larger,-1means left is larger),bis the Y-axis direction scale (1means bottom is larger,-1means top is larger), andc,dare the x, y of the origin point of the projected coordinate system.
Methods
transform(coordinate, scale, out?): Point— Transform a projected coordinate to a 2D point;scaleis used to scale the result at different zoom levels.untransform(point, scale, out?): Coordinate— Transform a 2D point back to a projected coordinate;scaleis used to scale the result at different zoom levels.
Static Methods
Transformation has no static methods.
Events
Transformation has no events.