Changeset 1308
- Timestamp:
- 08/19/06 01:23:45 (2 years ago)
- Files:
-
- branches/openlayers/2.0/examples/google.html (modified) (2 diffs)
- branches/openlayers/2.0/lib/OpenLayers/Layer/Google.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/openlayers/2.0/examples/google.html
r1243 r1308 24 24 25 25 function init(){ 26 map = new OpenLayers.Map( $('map') ); 26 map = new OpenLayers.Map( $('map') , 27 { controls: [new OpenLayers.Control.MouseDefaults()] }); 27 28 28 var normal = new OpenLayers.Layer.Google( "Google" ); 29 var normal = new OpenLayers.Layer.Google( "Google", // ); 30 { minZoomLevel: 3, maxZoomLevel: 8 }); 29 31 var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP }); 30 32 var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP }); 31 33 32 34 33 map.addLayers([ normal, satellite, hybrid]);35 map.addLayers([satellite, normal, hybrid]); 34 36 35 37 markers = new OpenLayers.Layer.Markers("markers"); … … 38 40 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 39 41 map.addControl( new OpenLayers.Control.LayerSwitcher() ); 42 map.addControl( new OpenLayers.Control.PanZoomBar() ); 40 43 41 44 } branches/openlayers/2.0/lib/OpenLayers/Layer/Google.js
r1302 r1308 50 50 51 51 /** @type int */ 52 numZoomLevels: 16, 52 minZoomLevel: 0, 53 54 /** @type int */ 55 maxZoomLevel: 16, 53 56 54 57 … … 63 66 this.maxExtent = new OpenLayers.Bounds(-180, -90, 180, 90); 64 67 } 68 69 this.numZoomLevels = this.maxZoomLevel - this.minZoomLevel + 1; 65 70 }, 66 71 … … 264 269 var gBounds = this.getGLatLngBoundsFromOLBounds(bounds); 265 270 var gZoom = this.gmap.getBoundsZoomLevel(gBounds); 271 272 //make sure zoom is within bounds 273 var gZoom = Math.min(Math.max(gZoom, this.minZoomLevel), 274 this.maxZoomLevel); 275 276 266 277 zoom = this.getOLZoomFromGZoom(gZoom); 267 278 } … … 292 303 var zoom = null; 293 304 if (gZoom != null) { 294 zoom = gZoom ;305 zoom = gZoom - this.minZoomLevel; 295 306 } 296 307 return zoom; … … 307 318 var zoom = null; 308 319 if (olZoom != null) { 309 zoom = olZoom ;320 zoom = olZoom + this.minZoomLevel; 310 321 } 311 322 return zoom;
