latlon_to_xy
Converts Web Mercator coordinates to screen pixels and back
- Used for creating the SRT log viewer in https://djitelemetryoverlay.com/
Installation
Using npm:
$ npm install latlon_to_xy
Usage
//Load modulelet conversions = ; //set valuesconversions; //once the values are set, only one value is required for all calculations, and an alternative center value is optionallet x = conversions; //converts longitude to x, an alternative center can be provided in lon unitslet y = conversions; //converts latitude to y, an alternative center can be provided in lat unitslet lon = conversions; //converts x to longitude, an alternative center can be provided in lon unitslet lat = conversions; //converts y to latitude, an alternative center can be provided in lat units
TODO
- Provide method for calculating necessary zoom for a location to be inside the screen