Socket
Book a DemoInstallSign in
Socket

latlon_to_xy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

latlon_to_xy

Converts Web Mercator coordinates to screen pixels and back

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
4
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

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 module
let conversions = require('latlon_to_xy');

//set values
conversions.setupConversor(
  tile_height,
  zoom,
  center_longitude,
  center_latitude
);

//once the values are set, only one value is required for all calculations, and an alternative center value is optional
let x = conversions.lonToX(lon, altC); //converts longitude to x, an alternative center can be provided in lon units
let y = conversions.latToY(lat, altC); //converts latitude to y, an alternative center can be provided in lat units
let lon = conversions.xToLon(x, altC); //converts x to longitude, an alternative center can be provided in lon units
let lat = conversions.yToLat(y, altC); //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

Keywords

coordinates

FAQs

Package last updated on 18 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.