[OpenLayers-Users] Overviewbox causes "bounds is null "error
jas_gao
jas_gao at msn.com
Tue Mar 24 07:39:16 EDT 2009
Sorry, the code is unreadable above, here it is!.
var proj = new OpenLayers.Projection("EPSG:4326");
map = new OpenLayers.Map($('center'), {
maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
numZoomLevels: 18,
maxResolution: 156543.0339,
units: 'm',
projection: "EPSG:900913",
displayProjection: new OpenLayers.Projection("EPSG:4326")
});
maxZOOM = 21
var gphy = new OpenLayers.Layer.Google("Google Physical", {type: G_PHYSICAL_MAP, sphericalMercator : true, MAX_ZOOM_LEVEL:maxZOOM} );
var ghyb = new OpenLayers.Layer.Google("Google Hybrid", {type: G_HYBRID_MAP, sphericalMercator : true, MAX_ZOOM_LEVEL:maxZOOM} );
var gsat = new OpenLayers.Layer.Google("Google Satellite", {type: G_SATELLITE_MAP, sphericalMercator : true, MAX_ZOOM_LEVEL:maxZOOM} );
map.addLayers([gsat, gphy, ghyb]);
// adding overview here which causes error
var overviewoptions = {
maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
maxResolution: 156543.0339,
projection: "EPSG:900913",
displayProjection: new OpenLayers.Projection("EPSG:4326")
};
map.addControl(new OpenLayers.Control.OverviewMap({
div: OpenLayers.Util.getElement('overview'),
size: new OpenLayers.Size(200, 128),
mapOptions: overviewoptions
}));
--
View this message in context: http://n2.nabble.com/Overviewbox-causes-%22bounds-is-null-%22error-tp2526031p2526038.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list