From 411748a48ccf366a371558060a0eb6367f0f41d3 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 12 Oct 2012 13:18:28 -0700 Subject: [PATCH] Use baselayerchange event --- app/assets/javascripts/index.js | 2 +- app/assets/javascripts/index/export.js | 4 ++-- app/assets/javascripts/index/key.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index ddad384ab..34c3d8e6e 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -12,7 +12,7 @@ $(document).ready(function () { map.attributionControl.setPrefix(permalinks); - map.on("moveend layeradd layerremove", updateLocation); + map.on("moveend baselayerchange", updateLocation); if (!params.object_zoom) { if (params.bbox) { diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js index b014e8cb2..46cd105e4 100644 --- a/app/assets/javascripts/index/export.js +++ b/app/assets/javascripts/index/export.js @@ -17,7 +17,7 @@ $(document).ready(function () { map.on('draw:rectangle-created', endDrag); map.on("moveend", mapMoved); - map.on("layeradd layerremove", htmlUrlChanged); + map.on("baselayerchange", htmlUrlChanged); $("#sidebar_title").html(I18n.t('export.start_rjs.export')); $("#sidebar_content").html(sidebarHtml); @@ -50,7 +50,7 @@ $(document).ready(function () { clearMarker(); map.off("moveend", mapMoved); - map.off("layeradd layerremove", htmlUrlChanged); + map.off("baselayerchange", htmlUrlChanged); map.off('draw:rectangle-created', endDrag); drawHandler.disable(); diff --git a/app/assets/javascripts/index/key.js b/app/assets/javascripts/index/key.js index a4fbb6c64..9722cf4cf 100644 --- a/app/assets/javascripts/index/key.js +++ b/app/assets/javascripts/index/key.js @@ -26,9 +26,9 @@ $(document).ready(function () { openSidebar({ title: title }); $("#sidebar").one("closed", function () { - map.off("zoomend layeradd layerremove", updateMapKey); + map.off("zoomend baselayerchange", updateMapKey); }); - map.on("zoomend layeradd layerremove", updateMapKey); + map.on("zoomend baselayerchange", updateMapKey); }); }); -- 2.39.5