From 1f4e41f6725ea373aa13bbb067595e2c4fc326d8 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 12 Jun 2013 13:31:18 -0700 Subject: [PATCH 1/1] Fix export --- app/assets/javascripts/index.js | 1 + app/assets/javascripts/index/export.js | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index c96d18afd..9a975c11c 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -161,6 +161,7 @@ $(document).ready(function () { $("#query").focus(); } + initializeExport(map); initializeBrowse(map); initializeNotes(map); }); diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js index 3715cbf99..2baab4d4b 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 (getMapBaseLayerId(map) == "mapnik") { $("#format_mapnik").prop("checked", true); } @@ -186,7 +186,7 @@ $(document).ready(function () { function htmlUrlChanged() { var bounds = getBounds(); - var layerName = getMapBaseLayerId(); + var layerName = getMapBaseLayerId(map); 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 = getMapLayers(map); var text = I18n.t('export.start_rjs.view_larger_map'); var escaped = []; @@ -281,4 +281,4 @@ $(document).ready(function () { validateControls(); } } -}); +} -- 2.39.5