]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/diary_entry.js
Include current non-OSM.org hostname in share URL
[rails.git] / app / assets / javascripts / diary_entry.js
index 291c8652382a85ab4cee1414eb6ce5d962a8bfef..7c420b671b679901230be1b041a336e0bec676b4 100644 (file)
@@ -1,5 +1,5 @@
 $(document).ready(function () {
-  var marker;
+  var marker, map;
 
   function setLocation(e) {
     $("#latitude").val(e.latlng.lat);
@@ -21,7 +21,18 @@ $(document).ready(function () {
 
     var params = $("#map").data();
     var centre = [params.lat, params.lon];
-    var map = createMap("map");
+
+    map = L.map("map", {
+      attributionControl: false,
+      zoomControl: false
+    }).addLayer(new L.OSM.Mapnik());
+
+    L.OSM.zoom()
+      .addTo(map);
+
+    $("#map").on("resized", function () {
+      map.invalidateSize();
+    });
 
     map.setView(centre, params.zoom);