Add a javascript callback for Potlatch 2 to update links as the map moves
This commit is contained in:
parent
a4cb284409
commit
fef620e375
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue