openlayers: use the provided layer name and put the source in parenthesis

master
Antoine Beaupré 2012-08-24 17:29:41 -04:00
parent 081fd38636
commit 69467738ed
1 changed files with 4 additions and 4 deletions

View File

@ -70,11 +70,11 @@ function mapsetup(divname, options) {
} else { // OSM } else { // OSM
if (options.layers[layer] != 1) { if (options.layers[layer] != 1) {
l = options.layers[layer]; l = options.layers[layer];
fqdn = l.split("/")[2].split(".") fqdn = l.split("/")[2].split(".");
text = fqdn[fqdn.length-2] text = fqdn[fqdn.length-2] + "." + fqdn[fqdn.length-1];
map.addLayer(new OpenLayers.Layer.OSM("OpenStreetMap (" + text + ")", l)); map.addLayer(new OpenLayers.Layer.OSM(layer + " (" + text + ")", l));
} else { } else {
map.addLayer(new OpenLayers.Layer.OSM("OpenStreetMap (Mapnik)")); map.addLayer(new OpenLayers.Layer.OSM(layer + " (Mapnik)"));
} }
} }
} }