Dear:
I meet a problem when using WebTileLayer show the map data in EPSG:3826 format.
The code snippet is as following:
Is there any other methods can cover this problem? thanks a lot.
Solved! Go to Solution.
WebTileLayer's spatialReference is 102100. Looks like you are working with WMTS service (https://wmts.nlsc.gov.tw/97/wmts/). So I would add the layer as WMTSLayer as shown below.
const layer = new WMTSLayer({
url: "https://wmts.nlsc.gov.tw/97/wmts"
extent: {
xmin: 128548.4443375419,
ymin: 2394066.4166165744,
xmax: 606875.5521,
ymax: 2919551.2968000006,
spatialReference: { wkid: 3826 }
}
});
const map = new Map({
layers: [layer]
});
const view = new MapView({
container: "viewDiv",
map: map,
spatialReference: { wkid: 3826 },
});
WebTileLayer's spatialReference is 102100. Looks like you are working with WMTS service (https://wmts.nlsc.gov.tw/97/wmts/). So I would add the layer as WMTSLayer as shown below.
const layer = new WMTSLayer({
url: "https://wmts.nlsc.gov.tw/97/wmts"
extent: {
xmin: 128548.4443375419,
ymin: 2394066.4166165744,
xmax: 606875.5521,
ymax: 2919551.2968000006,
spatialReference: { wkid: 3826 }
}
});
const map = new Map({
layers: [layer]
});
const view = new MapView({
container: "viewDiv",
map: map,
spatialReference: { wkid: 3826 },
});