Skip to content

alvarcarto/mapsy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0732ca3 · Aug 26, 2018

History

6 Commits
Aug 26, 2018
Aug 26, 2018
Aug 26, 2018
Aug 26, 2018
Aug 26, 2018
Aug 26, 2018
Aug 26, 2018
Aug 26, 2018
Aug 26, 2018

Repository files navigation

mapsy

Map/coordinate/projection utility

npm install @alvarcarto/mapsy

This code base is copied subset of Leaflet to calculate zoom level for given lat/lng bounds. Also works in Node.

Examples

const { getBoundsZoom, LatLng, LatLngBounds } = require('@alvarcarto/mapsy');

const sw = new LatLng(60.139253532746466, 24.895589054037774);
const ne = new LatLng(60.210249282963126, 24.997550709955334);
const bounds = new LatLngBounds(sw, ne);
const zoom = getBoundsZoom(bounds, { width: 420, height: 588 });
console.log('Center:', bounds.getCenter(), 'Zoom:', zoom);

Contributors

Release

  • Commit all changes.

  • Use np to automate the release:

    np

  • Edit GitHub release notes.

License

Most of the code is a subset of https://github.com/Leaflet/Leaflet.

MIT

About

Map/coordinate/projection utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published