【发布时间】:2019-10-28 10:18:43
【问题描述】:
我在这篇文章How to fix EPSG:4326 with WMTS incorrect map overlay 中获得了类似示例的数据,它甚至具有我需要的相同来源。 但是,地图发生了变化。
private createLayer() {
this.service
.getTypesLayersFilter()
.subscribe((resp: TypesLayersFilters) => {
const filter = first(resp.WMTS);
const parser = new WMTSCapabilities();
const layer = 'ORTOFOTOMAPA';
const matrixSet = 'EPSG:4326';
this.wmtsService.getData().subscribe(text => {
const result = parser.read(text);
const options = optionsFromCapabilities(result, {
layer,
matrixSet,
crossOrigin: true
});
const layerNew = new TileLayer({
source: new WMTS(options),
opacity: 0.7,
name: 'WMTS',
});
});
});
}
来源: https://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/ORTO?SERVICE=WMTS&REQUEST=GetCapabilities
getData() {
const url =
'https://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/ORTO';
const data = {
SERVICE: 'WMTS',
REQUEST: 'GetCapabilities'
};
const options: any = { params: data, responseType: 'text' };
return this.http.get(url, {
...options,
params: this.toHttpParams(options.params)
});
}
什么会导致这种转变,我做错了什么吗?也许解决方案是移动地图,如果可能的话,应该这样做?
【问题讨论】: