X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a0c9cc7d0abee25f733bcf4ff9c8363bc5490427..e96a64ca9c2ea068dd9167e074ee26c8d28744b4:/app/assets/javascripts/diary_entry.js diff --git a/app/assets/javascripts/diary_entry.js b/app/assets/javascripts/diary_entry.js index 291c86523..e17f59ad2 100644 --- a/app/assets/javascripts/diary_entry.js +++ b/app/assets/javascripts/diary_entry.js @@ -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.control.zoom({position: 'topright'}) + .addTo(map); + + $("#map").on("resized", function () { + map.invalidateSize(); + }); map.setView(centre, params.zoom);