X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4863a9490601d954139e17741dd5144adf99f621..b70da7b8ea15ab48bb2f34155567cea6dffc8fc9:/app/assets/javascripts/index/browse.js diff --git a/app/assets/javascripts/index/browse.js b/app/assets/javascripts/index/browse.js index a47dd348e..07ad64def 100644 --- a/app/assets/javascripts/index/browse.js +++ b/app/assets/javascripts/index/browse.js @@ -1,4 +1,4 @@ -function initializeBrowse(map) { +OSM.initializeBrowse = function (map) { var browseBounds; var selectedLayer; var dataLayer = map.dataLayer; @@ -26,53 +26,49 @@ function initializeBrowse(map) { onSelect(e.layer); }); - map.on('layeradd', function (e) { + map.on("layeradd", function (e) { if (e.layer === dataLayer) { map.on("moveend", updateData); updateData(); } }); - map.on('layerremove', function (e) { + map.on("layerremove", function (e) { if (e.layer === dataLayer) { map.off("moveend", updateData); - $('#browse_status').empty(); + $("#browse_status").empty(); } }); function updateData() { - if (map.getZoom() >= 15) { - var bounds = map.getBounds(); - if (!browseBounds || !browseBounds.contains(bounds)) { - browseBounds = bounds; - getData(); - } + var bounds = map.getBounds(); + if (!browseBounds || !browseBounds.contains(bounds)) { + getData(); } } - function displayFeatureWarning(count, limit, callback) { - $('#browse_status').html( - $("
") - .text(I18n.t("browse.start_rjs.loaded_an_area_with_num_features", { num_features: count, max_features: limit })) + function displayFeatureWarning(count, limit, add, cancel) { + $("#browse_status").html( + $("