X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/de5a225a95125db1a66d6dfbaa3a790db9719c18..d414ffc61a0f6505f1d06e89e8668fa5b49d607e:/app/assets/javascripts/changeset.js?ds=sidebyside diff --git a/app/assets/javascripts/changeset.js b/app/assets/javascripts/changeset.js index 26c2351fa..0aecced85 100644 --- a/app/assets/javascripts/changeset.js +++ b/app/assets/javascripts/changeset.js @@ -1,18 +1,6 @@ -$(document).ready(function () { +function initializeChangesets(map) { var changesets = [], rects = {}; - var map = L.map("changeset_list_map", { - attributionControl: false, - zoomControl: false - }).addLayer(new L.OSM.Mapnik()); - - L.OSM.zoom() - .addTo(map); - - $("#changeset_list_map").on("resized", function () { - map.invalidateSize(); - }); - var group = L.featureGroup().addTo(map); $("[data-changeset]").each(function () { @@ -64,20 +52,4 @@ $(document).ready(function () { unHighlightChangeset($(this).data("changeset").id); } }); - - $(window).scroll(function() { - if ($(window).scrollTop() > $('.content-heading').outerHeight() + $('#top-bar').outerHeight() ) { - $('#changeset_list_map_wrapper').addClass('scrolled'); - } else { - $('#changeset_list_map_wrapper').removeClass('scrolled'); - } - }); - - var params = OSM.mapParams(); - if (params.bbox) { - map.fitBounds([[params.minlat, params.minlon], - [params.maxlat, params.maxlon]]); - } else { - map.fitBounds(group.getBounds()); - } -}); +}