Навигация с помощю history - little fix
This commit is contained in:
parent
e1c19f59ed
commit
a0881fb5d7
|
|
@ -138,16 +138,7 @@ window.addEventListener('popstate', function(e)
|
||||||
lng = e.state.lng;
|
lng = e.state.lng;
|
||||||
zoom = e.state.zoom;
|
zoom = e.state.zoom;
|
||||||
|
|
||||||
cLat = myMap.getCenter().lat;
|
|
||||||
cLng = myMap.getCenter().lng;
|
|
||||||
cZoom = myMap.getZoom();
|
|
||||||
|
|
||||||
if (lat != cLat || lng != cLng || zoom != cZoom)
|
|
||||||
{
|
|
||||||
myMap.setView([lat, lng], zoom);
|
myMap.setView([lat, lng], zoom);
|
||||||
} else {
|
|
||||||
window.history.go(-1);
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
if (e.state.hasOwnProperty('route'))
|
if (e.state.hasOwnProperty('route'))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue