X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2119911aa511d7340318367ae2e3c1dc98bcab76..8c788ce387fe147b3d74a7f89d003d61cb6d83d6:/app/assets/javascripts/browse.js diff --git a/app/assets/javascripts/browse.js b/app/assets/javascripts/browse.js index edfb4643a..0b60778d6 100644 --- a/app/assets/javascripts/browse.js +++ b/app/assets/javascripts/browse.js @@ -21,10 +21,16 @@ $(document).ready(function () { return false; } - var map = createMap("small_map", { - layerControl: false, - panZoomControl: false, - attributionControl: false + var map = L.map("small_map", { + attributionControl: false, + zoomControl: false + }).addLayer(new L.OSM.Mapnik()); + + L.control.zoom({position: 'topright'}) + .addTo(map); + + $("#small_map").on("resized", function () { + map.invalidateSize(); }); var params = $("#small_map").data(); @@ -33,7 +39,12 @@ $(document).ready(function () { [params.maxlat, params.maxlon]); map.fitBounds(bbox); - addBoxToMap(bbox); + + L.rectangle(bbox, { + weight: 2, + color: '#e90', + fillOpacity: 0 + }).addTo(map); $("#loading").hide(); $("#browse_map .geolink").show(); @@ -60,7 +71,7 @@ $(document).ready(function () { return remoteEditHandler(bbox); }); - updatelinks(params.lon, params.lat, 16, null, + updatelinks(params.lon, params.lat, 16, null, bbox.getWest(), bbox.getSouth(), bbox.getEast(), bbox.getNorth(), object); @@ -74,7 +85,7 @@ $(document).ready(function () { object.version = params.version - 1; } - addObjectToMap(object, { + addObjectToMap(object, map, { zoom: true, callback: function(extent) { $("#loading").hide();