X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ef73cc1f574124b10cda75188aa542d9f4d802bb..c71209507bbc80c3e90006e67b93388b61fd0336:/app/assets/javascripts/index/export.js diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js index 3715cbf99..417dfabd3 100644 --- a/app/assets/javascripts/index/export.js +++ b/app/assets/javascripts/index/export.js @@ -1,4 +1,4 @@ -$(document).ready(function () { +function initializeExport(map) { $("#exportanchor").click(function (e) { $.ajax({ url: $(this).data('url'), success: function (sidebarHtml) { startExport(sidebarHtml); @@ -38,7 +38,7 @@ $(document).ready(function () { openSidebar(); - if (getMapBaseLayerId() == "mapnik") { + if (map.getMapBaseLayerId() == "mapnik") { $("#format_mapnik").prop("checked", true); } @@ -186,7 +186,7 @@ $(document).ready(function () { function htmlUrlChanged() { var bounds = getBounds(); - var layerName = getMapBaseLayerId(); + var layerName = map.getMapBaseLayerId(); var url = "http://" + OSM.SERVER_URL + "/export/embed.html?bbox=" + bounds.toBBoxString() + "&layer=" + layerName; var markerUrl = ""; @@ -203,7 +203,7 @@ $(document).ready(function () { var zoom = map.getBoundsZoom(bounds); - var layers = getMapLayers(); + var layers = map.getLayersCode(); var text = I18n.t('export.start_rjs.view_larger_map'); var escaped = []; @@ -281,4 +281,4 @@ $(document).ready(function () { validateControls(); } } -}); +}