openlayers: use the provided layer name and put the source in parenthesis
authorAntoine Beaupré <anarcat@koumbit.org>
Fri, 24 Aug 2012 21:29:41 +0000 (17:29 -0400)
committerAntoine Beaupré <anarcat@koumbit.org>
Sat, 25 Aug 2012 12:20:30 +0000 (08:20 -0400)
underlays/osm/ikiwiki/osm.js

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