commit 4ed6bc3fba0598fa961a18bbf178adce80e2f76c
parent 38587038d3416557bd7dd3e030fe042cdd69c45e
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Thu, 10 Nov 2016 00:05:31 +0300
fixed loading map position from hash state for longitudes >180 and saving
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/lib/hashState/Leaflet.Map.js b/src/lib/hashState/Leaflet.Map.js
@@ -11,7 +11,7 @@ L.Map.include({
var zoom = this.getZoom();
var precision = 5;
var state = [
- zoom,
+ zoom.toString(),
center.lat.toFixed(precision),
center.lng.toFixed(precision),
];
@@ -25,8 +25,7 @@ L.Map.include({
var zoom = parseInt(values[0], 10),
lat = parseFloat(values[1]),
lng = parseFloat(values[2]);
- if (isNaN(zoom) || isNaN(lat) || isNaN(lng) || zoom < 0 || zoom > 32 || lat < -90 || lat > 90 || lng < -180 ||
- lng > 180) {
+ if (isNaN(zoom) || isNaN(lat) || isNaN(lng) || zoom < 0 || zoom > 32 || lat < -90 || lat > 90 ) {
return false;
}
// this._updating_state = true;