Навигация с помощю history - little fix

This commit is contained in:
Krivchikov Dmitry 2014-10-05 18:49:36 +04:00
parent e1c19f59ed
commit a0881fb5d7
1 changed files with 1 additions and 10 deletions

View File

@ -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; myMap.setView([lat, lng], zoom);
cLng = myMap.getCenter().lng;
cZoom = myMap.getZoom();
if (lat != cLat || lng != cLng || zoom != cZoom)
{
myMap.setView([lat, lng], zoom);
} else {
window.history.go(-1);
}
} else } else
if (e.state.hasOwnProperty('route')) if (e.state.hasOwnProperty('route'))
{ {