Using DOM renderer; no custom extent for layers
The server does not send CORS headers, so we cannot use the WebGL renderer. Since the layers use the projection's extent, it is not necessary to specify the extent.
This commit is contained in:
@@ -28,8 +28,7 @@ var layers = new ol.Collection([
|
|||||||
'Pixelmap 1:1000000 / geo.admin.ch</a>')],
|
'Pixelmap 1:1000000 / geo.admin.ch</a>')],
|
||||||
crossOrigin: null,
|
crossOrigin: null,
|
||||||
params: {'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale'},
|
params: {'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale'},
|
||||||
projection: epsg21781,
|
projection: epsg21781
|
||||||
extent: extent
|
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
new ol.layer.TileLayer({
|
new ol.layer.TileLayer({
|
||||||
@@ -41,13 +40,13 @@ var layers = new ol.Collection([
|
|||||||
'National parks / geo.admin.ch</a>')],
|
'National parks / geo.admin.ch</a>')],
|
||||||
crossOrigin: null,
|
crossOrigin: null,
|
||||||
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
|
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
|
||||||
projection: epsg21781,
|
projection: epsg21781
|
||||||
extent: extent
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
renderer: ol.RendererHint.DOM,
|
||||||
center: new ol.Coordinate(660000, 190000),
|
center: new ol.Coordinate(660000, 190000),
|
||||||
projection: epsg21781,
|
projection: epsg21781,
|
||||||
layers: layers,
|
layers: layers,
|
||||||
|
|||||||
Reference in New Issue
Block a user