@mapbox/sphericalmercator

WebJar for @mapbox/sphericalmercator

Лицензия

Лицензия

BSD
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

mapbox__sphericalmercator
Последняя версия

Последняя версия

1.0.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

@mapbox/sphericalmercator
WebJar for @mapbox/sphericalmercator
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/mapbox/sphericalmercator

Скачать mapbox__sphericalmercator

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mapbox__sphericalmercator/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mapbox__sphericalmercator</artifactId>
    <version>1.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mapbox__sphericalmercator/
implementation 'org.webjars.npm:mapbox__sphericalmercator:1.0.5'
// https://jarcasting.com/artifacts/org.webjars.npm/mapbox__sphericalmercator/
implementation ("org.webjars.npm:mapbox__sphericalmercator:1.0.5")
'org.webjars.npm:mapbox__sphericalmercator:jar:1.0.5'
<dependency org="org.webjars.npm" name="mapbox__sphericalmercator" rev="1.0.5">
  <artifact name="mapbox__sphericalmercator" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mapbox__sphericalmercator', version='1.0.5')
)
libraryDependencies += "org.webjars.npm" % "mapbox__sphericalmercator" % "1.0.5"
[org.webjars.npm/mapbox__sphericalmercator "1.0.5"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Build Status

sphericalmercator provides projection math for converting between mercator meters, screen pixels (of 256x256 or configurable-size tiles), and latitude/longitude.

Compatible with nodejs packages and in-browser.

Installation

npm install @mapbox/sphericalmercator

API

Some datatypes are assumed to be arrays: ll is [lon, lat], xy and px are [x, y].

// By default, precomputes up to z30
var merc = new SphericalMercator({
    size: 256
});

px(ll, zoom)

Convert lon, lat to screen pixel x, y from 0, 0 origin, at a certain zoom level. The inverse of ll

ll(px, zoom)

Convert screen pixel value to lon, lat, at a certain zoom level. The inverse of px

bbox(x, y, zoom, tms_style, srs)

Convert tile xyz value to bbox of the form [w, s, e, n]

  • x {Number} x (longitude) number.
  • y {Number} y (latitude) number.
  • zoom {Number} zoom.
  • tms_style {Boolean} whether to compute using tms-style. (optional, default false)
  • srs {String} projection for resulting bbox (WGS84|900913). (optional, default WGS84)

Returns bbox array of values in form [w, s, e, n].

xyz(bbox, zoom, tms_style, srs)

Convert bbox to xyz bounds

  • bbox {Number} bbox in the form [w, s, e, n].
  • zoom {Number} zoom.
  • tms_style {Boolean} whether to compute using tms-style. (optional, default false)
  • srs {String} projection of input bbox (WGS84|900913). (optional, default WGS84)

Returns {Object} XYZ bounds containing minX, maxX, minY, maxY properties.

convert(bbox, to)

Convert bbox from 900913 to WGS84 or vice versa

  • bbox {Number} bbox in the form [w, s, e, n].
  • to {String} projection of resulting bbox (WGS84|900913). (optional, default WGS84)

Returns bbox array of values in form [w, s, e, n].

forward(ll)

Convert lon, lat values to mercator x, y

inverse(xy)

Convert mercator x, y values to lon, lat

See Also

  • mercantile provides similar utilities for projection and tile math in Python
org.webjars.npm

Mapbox

Mapbox is the location data platform for mobile and web applications. We're changing the way people move around cities and explore our world.

Версии библиотеки

Версия
1.0.5