From: Tom Hughes Date: Fri, 3 Dec 2010 15:08:48 +0000 (+0000) Subject: Add a javascript callback for Potlatch 2 to update links as the map moves X-Git-Tag: live~6841^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/fef620e375faf7a168518d12f670ff26d0890aae?ds=sidebyside;hp=--cc Add a javascript callback for Potlatch 2 to update links as the map moves --- fef620e375faf7a168518d12f670ff26d0890aae diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index cda423e29..a72975dd7 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -37,6 +37,7 @@ fo.addVariable("oauth_consumer_secret","<%= token.client_application.secret %>"); fo.addVariable("maximise_function","maximiseMap"); fo.addVariable("minimise_function","minimiseMap"); + fo.addVariable("move_function","mapMoved"); fo.write("map"); } @@ -45,4 +46,8 @@ function setPosition(lat, lon, zoom) { $("potlatch").setPosition(lat, lon, Math.max(zoom || 15, 13)); } + + function mapMoved(lon, lat, zoom, minlon, minlat, maxlon, maxlat) { + updatelinks(lon, lat, zoom, null, minlon, minlat, maxlon, maxlat); + }