X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/378d08f2c92adf0c1d14bbe09fcebe9f5e786409..56db9ca2b7e2475cd8025630049fb4a4b824f2d9:/app/assets/javascripts/index/export.js diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js index 04c6b6ff7..31a981ec9 100644 --- a/app/assets/javascripts/index/export.js +++ b/app/assets/javascripts/index/export.js @@ -15,7 +15,7 @@ $(document).ready(function () { var locationFilter = new L.LocationFilter({ enableButton: false, - adjustButton: false, + adjustButton: false }).addTo(map); locationFilter.on("change", filterChanged); @@ -38,7 +38,7 @@ $(document).ready(function () { openSidebar(); - if (map.hasLayer(layers[0].layer)) { + if (getMapBaseLayer().keyid == "mapnik") { $("#format_mapnik").prop("checked", true); } @@ -83,15 +83,18 @@ $(document).ready(function () { var bounds = getBounds(); map.fitBounds(bounds); - - enableFilter(); locationFilter.setBounds(bounds); + enableFilter(); validateControls(); mapnikSizeChanged(); } function enableFilter() { + if (!locationFilter.getBounds().isValid()) { + locationFilter.setBounds(map.getBounds().pad(-0.2)); + } + $("#drag_box").hide(); locationFilter.enable(); }