]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/export.js
Merge remote-tracking branch 'upstream/master' into vagrant
[rails.git] / app / assets / javascripts / index / export.js
index 053f5169fa9832e622695042b88d18357b204169..6e6867e5b5a15f5139f8b7ac5cac1d3ea3fa7af4 100644 (file)
@@ -36,11 +36,16 @@ OSM.Export = function(map) {
   }
 
   function setBounds(bounds) {
   }
 
   function setBounds(bounds) {
-    var precision = zoomPrecision(map.getZoom());
+    var precision = OSM.zoomPrecision(map.getZoom());
     $("#minlon").val(bounds.getWest().toFixed(precision));
     $("#minlat").val(bounds.getSouth().toFixed(precision));
     $("#maxlon").val(bounds.getEast().toFixed(precision));
     $("#maxlat").val(bounds.getNorth().toFixed(precision));
     $("#minlon").val(bounds.getWest().toFixed(precision));
     $("#minlat").val(bounds.getSouth().toFixed(precision));
     $("#maxlon").val(bounds.getEast().toFixed(precision));
     $("#maxlat").val(bounds.getNorth().toFixed(precision));
+
+    $("#export_overpass").attr("href",
+        "http://overpass-api.de/api/map?bbox=" +
+        $("#minlon").val() + "," + $("#minlat").val() + "," +
+        $("#maxlon").val() + "," + $("#maxlat").val());
   }
 
   function validateControls() {
   }
 
   function validateControls() {