X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c8fb5ad24c5751bd2d43b86e4359381d200af066..1a51f2187127f7376e2118b5a4ced49123b0504a:/app/views/site/_potlatch2.html.erb?ds=sidebyside diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index 51c9aa905..9edf6b5f7 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -85,7 +85,12 @@ }); }); - function mapMoved(lon, lat, zoom, minlon, minlat, maxlon, maxlat) { + var mapMoved = $.throttle(250, function(lon, lat, zoom, minlon, minlat, maxlon, maxlat) { updatelinks({ lon: lon, lat: lat }, zoom, null, [[minlat, minlon], [maxlat, maxlon]]); - } + + var hash = OSM.formatHash({ lon: lon, lat: lat, zoom: zoom }); + if (hash !== location.hash) { + location.replace(hash); + } + });