Set the number of zoom levels for the marker layer based on the
authorTom Hughes <tom@compton.nu>
Thu, 6 Dec 2007 13:46:56 +0000 (13:46 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 6 Dec 2007 13:46:56 +0000 (13:46 +0000)
maximum number of zoom levels of any of the base layers.

public/javascripts/map.js

index 0f842cf48d697e08e98fb6c60c6bb78d64d83b4b..046c754568fd87e957518281a1860a0dc90d38af 100644 (file)
@@ -15,7 +15,8 @@ function createMap(divName) {
    var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", { displayOutsideMaxExtent: true });
    map.addLayer(osmarender);
 
-   markers = new OpenLayers.Layer.Markers("markers", { visibility: false });
+   var numZoomLevels = Math.max(mapnik.numZoomLevels, osmarender.numZoomLevels);
+   markers = new OpenLayers.Layer.Markers("Markers", { visibility: false, numZoomLevels: numZoomLevels });
    map.addLayer(markers);
 
    map.addControl(new OpenLayers.Control.LayerSwitcher());