[OpenLayers-Users] add, remove base layers depending on zoom,
change baselayer
Maria Panagou
snowdrop at ath.forthnet.gr
Mon Jan 14 15:53:08 EST 2008
I figured out the proper syntax and tried it again using
map.events.register("zoomend", map, function() {
if (map.getZoom()>0) {
if (satellite.displayInLayerSwitcher== false) {
satellite.displayInLayerSwitcher= true;
map.setBaseLayer(satellite);
satellite.setVisibility(true);
//switcher.updateMap;
}
}
else
{
satellite.displayInLayerSwitcher= false;
map.setBaseLayer(nomoi);
satellite.setVisibility(false);
}
});
this works when zooming in and for a little while zooming back to first zoom
but then nothing happens when I click the zoom out button in panzoombar and
the browser stops responding. tried that with firefox and IE. no errors in
firebug
thanks for you idea. I managed to set these options correctly upon creating
the layers e.g:
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type:
G_SATELLITE_MAP, MIN_ZOOM_LEVEL: 7, maxExtent:extent,
displayInLayerSwitcher: false, visible: false} );
but how do i change these properties later?
--
View this message in context: http://www.nabble.com/add%2C-remove-base-layers-depending-on-zoom%2C-change-baselayer-tp14789355p14814188.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list