[OpenLayers-Users] Problem with overview map
Subha Ramakrishnan
subha at gslab.com
Wed Oct 15 01:44:20 EDT 2008
Hi,
I'm using Openlayers Overview map control with Google Physical map which
is also my base map.
And i am using a restricted extent on the overview map to show India.
Now, when i change my map's base layer to say Google Satellite, I change
the layer in the overview map
to match the map's base layer. The problem i am facing here is, whenever
the base layer changes, the restricted extent on my overview map moves
to Australia and India is no where seen.
Does anyone know why this is happening?
Here's the code:
This is when i initialize the map.
overviewLayer = new OpenLayers.Layer.Google("Google Physical",{type:
G_PHYSICAL_MAP,MIN_ZOOM_LEVEL: 2,
'sphericalMercator': true,minExtent:new
OpenLayers.Bounds(6567849.955888889,1574216.547942332,
11354588.059333334,3763310.626620795), maxExtent:new
OpenLayers.Bounds(6901808.428222222,-7.081154550627198,
11131949.077777777, 4439106.786632658)});
addOverview(overviewLayer);
function addOverview(overviewLayer){
//to remove already existing overviewmap
if(overview != ''){map.removeControl(overview);}
var overviewOptions = {
layers: [overviewLayer],
projection: "EPSG:900913",
units: "m",
maxResolution: "0.17578125"
};
overview = new OpenLayers.Control.OverviewMap(overviewOptions);
overview.isSuitableOverview = function(){
return false;
};
map.addControl(overview);
overview.maximizeControl();
}
Thanks & regards,
Subha
More information about the Users
mailing list