Wrap longitude values explicitly
Leaflet 0.5 no longer wraps longitude values, so we need to do it.
This commit is contained in:
parent
08dba25d7a
commit
f612f573f9
2 changed files with 6 additions and 2 deletions
|
@ -65,10 +65,10 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateLocation() {
|
function updateLocation() {
|
||||||
var center = map.getCenter();
|
var center = map.getCenter().wrap();
|
||||||
var zoom = map.getZoom();
|
var zoom = map.getZoom();
|
||||||
var layers = getMapLayers();
|
var layers = getMapLayers();
|
||||||
var extents = map.getBounds();
|
var extents = map.getBounds().wrap();
|
||||||
|
|
||||||
updatelinks(center.lng,
|
updatelinks(center.lng,
|
||||||
center.lat,
|
center.lat,
|
||||||
|
|
|
@ -29,6 +29,10 @@ L.extend(L.LatLngBounds.prototype, {
|
||||||
getSize: function () {
|
getSize: function () {
|
||||||
return (this._northEast.lat - this._southWest.lat) *
|
return (this._northEast.lat - this._southWest.lat) *
|
||||||
(this._northEast.lng - this._southWest.lng);
|
(this._northEast.lng - this._southWest.lng);
|
||||||
|
},
|
||||||
|
|
||||||
|
wrap: function () {
|
||||||
|
return new L.LatLngBounds(this._southWest.wrap(), this._northEast.wrap());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue