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.
This commit is contained in:
Tom Hughes 2010-04-11 23:35:10 +00:00
parent 7e837dd558
commit 79df86023c
2 changed files with 4 additions and 1 deletions

View file

@ -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",

View file

@ -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
});