X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/78f608b114c05f1147936a57b930831e28000c1a..e8ac6bd5d918bb71647c05da4b2b294a1423948b:/app/assets/javascripts/changeset.js?ds=sidebyside diff --git a/app/assets/javascripts/changeset.js b/app/assets/javascripts/changeset.js index 152b3b4f7..0aecced85 100644 --- a/app/assets/javascripts/changeset.js +++ b/app/assets/javascripts/changeset.js @@ -1,6 +1,6 @@ -$(document).ready(function () { +function initializeChangesets(map) { var changesets = [], rects = {}; - var map = createMap("changeset_list_map"); + var group = L.featureGroup().addTo(map); $("[data-changeset]").each(function () { @@ -27,12 +27,12 @@ $(document).ready(function () { function highlightChangeset(id) { rects[id].setStyle({fillOpacity: 0.5}); - $("#tr-changeset-" + id).addClass("selected"); + $("#changeset_" + id).addClass("selected"); } function unHighlightChangeset(id) { rects[id].setStyle({fillOpacity: 0}); - $("#tr-changeset-" + id).removeClass("selected"); + $("#changeset_" + id).removeClass("selected"); } group.on({ @@ -52,12 +52,4 @@ $(document).ready(function () { unHighlightChangeset($(this).data("changeset").id); } }); - - var params = OSM.mapParams(); - if (params.bbox) { - map.fitBounds([[params.minlat, params.minlon], - [params.maxlat, params.maxlon]]); - } else { - map.fitBounds(group.getBounds()); - } -}); +}