[OpenLayers-Users] How can I set the Initial extents of my map?
Robert Buckley
robertdbuckley at yahoo.com
Tue Jul 12 03:47:43 EDT 2011
Hello,
In my project (http://maps.zgb.de/www/eeg/wea_wfs.html) I am pretty irritated by
the fact that the map initates by showing the full extents of the
sphericalmercator for a couple of seconds before zooming into the extents of the
data.
I would like the map to jump straight into the defined extents in the map object
ie .maxExtent: new OpenLayers.Bounds(912352.369449, 6720955.021855,
1391765.410767, 7014473.210418),
I am not sure if this occurs "whilst" the data is loading, but I would like the
map to be restricted to these extents and not to render the whole projection
before the data is loaded.
Can anyone help?,
Yours,
Rob
var mapOptions = {
projection:epsg3857,
displayProjection: new OpenLayers.Projection(epsg3857),
units: "m",
minScale: 1000,
numZoomLevels: 21,
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(912352.369449, 6720955.021855,
1391765.410767, 7014473.210418),
controls: [new OpenLayers.Control.MouseDefaults()
,new OpenLayers.Control.PanZoomBar()
,new OpenLayers.Control.MousePosition()
//,new OpenLayers.Control.LayerSwitcher()
,new OpenLayers.Control.ScaleLine({geodesic: true})]
};
map_wea = new OpenLayers.Map("map_wea", mapOptions);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110712/346203e8/attachment.html
More information about the Users
mailing list