allow google layer to be configured with min/max zoomLevels. update example.

git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1308 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-08-19 05:23:45 +00:00
parent 1e8c8e8404
commit 2ec05163ed
2 changed files with 20 additions and 6 deletions

View File

@@ -23,20 +23,23 @@
var map, layer;
function init(){
map = new OpenLayers.Map( $('map') );
map = new OpenLayers.Map( $('map') ,
{ controls: [new OpenLayers.Control.MouseDefaults()] });
var normal = new OpenLayers.Layer.Google( "Google" );
var normal = new OpenLayers.Layer.Google( "Google", // );
{ minZoomLevel: 3, maxZoomLevel: 8 });
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP });
var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP });
map.addLayers([normal, satellite, hybrid]);
map.addLayers([satellite, normal, hybrid]);
markers = new OpenLayers.Layer.Markers("markers");
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
map.addControl( new OpenLayers.Control.PanZoomBar() );
}