Package Exports
- viewport-mercator-project
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (viewport-mercator-project) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
viewport-mercator-project
Documentation is available in the website or in the docs folder).
Utility to convert map or world coordinates to screen coordinates back and forth
npm install viewport-mercator-project --save
Overview
Projection and camera utilities supporting the Web Mercator Projection. At its core this is a utility for converting to and from map coordinates (i.e. latitude, longitude) to screen coordinates and back.
FlatMercatorViewport
- For 2D applications, a simple, fast utility is provided that supports the basic flat Web Mercator projection and unprojection between geo coordinates and pixels.PerspectiveMercatorViewport
- For 3D applications, a subclass of a genericViewport
class (which is essentially a 3D matrix "camera" class of the type you would find in any 3D/WebGL/OpenGL library).
The constructor of this "advanced" perspective-enabled viewport also takes the same typical map view parameters as the FlatMercatorViewport
, however it offers perspective enabled/project unproject functions, and generates general 4x4 view matrices that correspond to the parameters.
Who is this for?
Specifically built for use with deck.gl and react-map-gl, but could be useful for any web mapping application that wants to support perspective enabled Web Mercator Projections with floating point zoom levels.