From: Tom Hughes Date: Sun, 11 Apr 2010 23:35:10 +0000 (+0000) Subject: Add a keyid attribute to each layer and use it when requesting the X-Git-Tag: live~6375^2~15 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/79df86023c5db1f1c47c80808565733c1200656a?ds=sidebyside Add a keyid attribute to each layer and use it when requesting the key instead of trying to use the layer name, which can be translated which will stop it working. Closes #2876. --- diff --git a/app/views/site/_key.html.erb b/app/views/site/_key.html.erb index 22261900d..e990071c8 100644 --- a/app/views/site/_key.html.erb +++ b/app/views/site/_key.html.erb @@ -17,7 +17,7 @@ } function updateMapKey() { - var layer = map.baseLayer.name.toLowerCase().replace(/\s+/g, "_"); + var layer = map.baseLayer.keyid; var zoom = map.getZoom(); <%= remote_function :update => "sidebar_content", diff --git a/public/javascripts/map.js b/public/javascripts/map.js index ab15198ab..732dbb823 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -32,18 +32,21 @@ function createMap(divName, options) { }); var mapnik = new OpenLayers.Layer.OSM.Mapnik(i18n("javascripts.map.base.mapnik"), { + keyid; "mapnik", displayOutsideMaxExtent: true, wrapDateLine: true }); map.addLayer(mapnik); var osmarender = new OpenLayers.Layer.OSM.Osmarender(i18n("javascripts.map.base.osmarender"), { + keyid: "osmarender", displayOutsideMaxExtent: true, wrapDateLine: true }); map.addLayer(osmarender); var cyclemap = new OpenLayers.Layer.OSM.CycleMap(i18n("javascripts.map.base.cycle_map"), { + keyid: "cyclemap", displayOutsideMaxExtent: true, wrapDateLine: true });