From: Tom Hughes Date: Thu, 6 Dec 2007 13:46:56 +0000 (+0000) Subject: Set the number of zoom levels for the marker layer based on the X-Git-Tag: live~8011 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/3ed64ceb54934393c9f39b2b0b15e6835a8595d1 Set the number of zoom levels for the marker layer based on the maximum number of zoom levels of any of the base layers. --- diff --git a/public/javascripts/map.js b/public/javascripts/map.js index 0f842cf48..046c75456 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -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());