Skip to content

Commit

Permalink
add option to support cross antimeridian px calculations
Browse files Browse the repository at this point in the history
* also prepare for immediate release of v1.2.0
  • Loading branch information
Josh Erb authored Sep 21, 2021
2 parents 39c15e4 + a0a7bfc commit eefe39e
Show file tree
Hide file tree
Showing 6 changed files with 1,104 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.2.0

- Add support for calculating `px` values for longitudes >180 (@riastrad) [#44](https://github.com/mapbox/sphericalmercator/pull/44)

## v1.1.0

- Add support for floating point zoom levels in `ll` and `px` methods (@orionstein) [#32](https://github.com/mapbox/sphericalmercator/pull/32)
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Some datatypes are assumed to be arrays: `ll` is `[lon, lat]`, `xy` and `px` are
```javascript
// By default, precomputes up to z30
var merc = new SphericalMercator({
size: 256
size: 256,
antimeridian: true
});
```

Expand All @@ -27,6 +28,8 @@ var merc = new SphericalMercator({
Convert lon, lat to screen pixel x, y from 0, 0 origin, at a certain zoom level.
The inverse of `ll`

If `antimeridian: true` is passed on initialization of the `SphericalMercator` object, this method will support converting longitude values up to 360°.

### `ll(px, zoom)`

Convert screen pixel value to lon, lat, at a certain zoom level. The inverse
Expand Down
Loading

0 comments on commit eefe39e

Please sign in to comment.