Изменение координат в урле, обработка пришедших координат
This commit is contained in:
parent
d625dbfe59
commit
57a93f1c1f
|
|
@ -50,6 +50,12 @@ function init() {
|
|||
}
|
||||
});
|
||||
|
||||
myMap.events.add('boundschange', function(e){
|
||||
if (!myMap.balloon.isOpen()) {
|
||||
history.pushState({}, document.title, "/?lat="+e.get('newCenter')[0]+"&lng="+e.get('newCenter')[1]+"&zoom="+e.get('newZoom'));
|
||||
}
|
||||
});
|
||||
|
||||
im = new ymaps.Placemark(
|
||||
[ymaps.geolocation.latitude, ymaps.geolocation.longitude],
|
||||
{
|
||||
|
|
@ -103,6 +109,9 @@ function getPoints()
|
|||
if (getURLParameter('point') != 'null')
|
||||
{
|
||||
showInfo(getURLParameter('point'));
|
||||
} else if ( (getURLParameter('lat') != 'null')&&(getURLParameter('lng') != 'null')&&(getURLParameter('zoom') != 'null') )
|
||||
{
|
||||
myMap.setCenter([getURLParameter('lat'), getURLParameter('lng')], getURLParameter('zoom'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue