]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Prevent click propagation on ui panes
[rails.git] / app / assets / javascripts / index.js
index 9f0c8649340e63678c8288f60b0e0fa88c7ff093..0e3e7cd563f433e84150451b61269409f50b29ee 100644 (file)
@@ -3,12 +3,36 @@
 //= require index/export
 //= require index/key
 //= require index/notes
+//= require index/map_ui
 
 $(document).ready(function () {
   var permalinks = $("#permalink").detach().html();
   var marker;
   var params = OSM.mapParams();
-  var map = createMap("map");
+  var map = createMap("map", {
+    zoomControl: false,
+    layerControl: false
+  }, {
+    locateControl: true
+  });
+
+  L.control.zoom({position: 'topright'})
+    .addTo(map);
+
+  OSM.mapUI().addTo(map);
+
+  L.control.share({
+      getUrl: function(map) {
+          return setArgs('http://osm.org/', {
+              lon: map.getCenter().lng,
+              lat: map.getCenter().lat
+          });
+      }
+  }).addTo(map);
+
+  L.control.locate({
+      position: 'topright'
+  }).addTo(map);
 
   L.control.scale().addTo(map);