From: John Firebaugh Date: Thu, 18 Apr 2013 21:57:25 +0000 (-0700) Subject: Call updatelinks when map moves X-Git-Tag: live~5002^2~9 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/55a0ad693d72a04d249db7af9129a262a4f9aee4?ds=sidebyside Call updatelinks when map moves Fixes systemed/iD#1330. --- diff --git a/app/views/site/id_iframe.html.erb b/app/views/site/id_iframe.html.erb index 5c061ea3a..b32b96a43 100644 --- a/app/views/site/id_iframe.html.erb +++ b/app/views/site/id_iframe.html.erb @@ -28,6 +28,22 @@ oauth_token_secret: "<%= token.secret %>" }); + id.map().on('move.embed', function() { + var extent = id.map().extent(), + zoom = ~~id.map().zoom(), + center = id.map().center(); + + parent.updatelinks( + center[0], + center[1], + zoom, + null, + extent[0][0], + extent[0][1], + extent[1][0], + extent[1][1]); + }); + d3.select('#id-container') .call(id.ui()); }