【发布时间】:2021-11-29 05:24:40
【问题描述】:
我将 OpenLayers 与 OSM 和 Geoporttail 一起使用。我在底部显示 OSM,在顶部显示 Geoporttail。
在法国我没有问题,但在其他国家 Geoporttail 没有用于大缩放的图块。在这种情况下,Geoporttail 返回 404,openLayers 保留之前的图块/图像并在内部放大:/
我希望在 Geoporttail 磁贴不存在时隐藏它,这样我会看到 OSM 磁贴。
知道怎么做吗?
我添加两个图层的代码:
layers: [
new OlTile({
'title': 'OSM',
source: new OlOSM()
}),
new OlTile({
source : new WMTS({
url: 'https://wxs.ign.fr/pratique/geoportail/wmts',
layer: 'ORTHOIMAGERY.ORTHOPHOTOS',
matrixSet: 'PM',
format: 'image/jpeg',
projection: 'EPSG:3857',
tileGrid: new WMTSTileGrid({
origin: [-20037508, 20037508],
resolutions: resolutions,
matrixIds: matrixIds,
}),
style: 'normal'
})
})
],
谢谢
【问题讨论】:
-
在图层选项openlayers.org/en/latest/apidoc/…中指定
useInterimTilesOnError: false -
你拯救了我的一天,非常感谢!
标签: http-status-code-404 openlayers layer