Ensure example opens at correct zoom

Set multiWorld: true so view opens at zoom 2 on wide displays
Set wrapX false on source
This commit is contained in:
mike-000
2020-02-27 20:53:58 +00:00
committed by GitHub
parent 0fd336daa5
commit 203f557883

View File

@@ -140,7 +140,8 @@ const geojsonObject = {
}; };
const source = new VectorSource({ const source = new VectorSource({
features: (new GeoJSON()).readFeatures(geojsonObject) features: (new GeoJSON()).readFeatures(geojsonObject),
wrapX: false
}); });
const layer = new VectorLayer({ const layer = new VectorLayer({
@@ -232,6 +233,7 @@ const map = new Map({
target: 'map', target: 'map',
view: new View({ view: new View({
center: [0, 1000000], center: [0, 1000000],
zoom: 2 zoom: 2,
multiWorld: true
}) })
}); });