Not that it needs to be this way, but because it is generally safer, set non-default resolution related properties on the map instead of on the layer. (closes #2031)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9211 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-04-06 18:29:48 +00:00
parent f5269f8acd
commit 64b4752592

View File

@@ -8,7 +8,13 @@
<script type="text/javascript">
var map;
function init() {
map = new OpenLayers.Map("map", {allOverlays: true});
map = new OpenLayers.Map({
div: "map",
allOverlays: true,
maxExtent: new OpenLayers.Bounds(
1549471.9221, 6403610.94, 1550001.32545, 6404015.8
)
});
// give the features some style
var styles = new OpenLayers.StyleMap({
@@ -37,13 +43,9 @@
url: "data/roads.json",
format: new OpenLayers.Format.GeoJSON()
}),
styleMap: styles,
maxExtent: new OpenLayers.Bounds(
1549471.9221, 6403610.94, 1550001.32545, 6404015.8
)
styleMap: styles
});
map.addLayer(vectors);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();