Load search result locations in iD
authorJohn Firebaugh <john.firebaugh@gmail.com>
Fri, 19 Apr 2013 21:45:06 +0000 (14:45 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Fri, 3 May 2013 17:52:43 +0000 (10:52 -0700)
app/views/site/id_iframe.html.erb

index b32b96a43aa330d5d9c9262ab425cc58eeb52ffd..8ca8523d1e05df0cdb7da3213d78253161ac3520 100644 (file)
         extent[1][1]);
     });
 
+    parent.$("body").on("click", "a.set_position", function (e) {
+      e.preventDefault();
+      var data = parent.$(this).data();
+      id.map().centerZoom(
+        [data.lon, data.lat],
+        Math.max(data.zoom || 15, 13));
+    });
+
     d3.select('#id-container')
       .call(id.ui());
   }