wr cookie 외

This commit is contained in:
ljpark
2025-10-17 17:29:26 +09:00
parent 0f9d13a80a
commit 89bb35bb3c
17 changed files with 117 additions and 154 deletions
@@ -149,31 +149,56 @@ GisApp.core.prototype = {
const resolutions = [1044.48, 522.24, 261.12, 130.56, 65.28, 32.64, 16.32, 8.16, 4.08, 2.04, 1.02, 0.51, 0.255];
const matrixIds = ["L06", "L07", "L08", "L09", "L10", "L11", "L12", "L13", "L14", "L15", "L16", "L17", "L18"];
const templateUrl = process.env.NEXT_PUBLIC_NGII_URL;
const tileGrid = new WMTSTileGrid({
origin: getTopLeft(projection.getExtent()),
resolutions: resolutions,
matrixIds: matrixIds,
tileSize: [256, 256],
});
const wmtsSource = new TileWMTS({
url: GisApp.NGII_WMTS_URL,
//url: GisApp.NGII_WMTS_URL,
projection: projection,
tileGrid: tileGrid,
crossOrigin: "anonymous",
requestEncoding: "KVP",
layer: _layer,
matrixSet: 'EPSG:5179',
format: 'image/png',
projection: projection,
style: 'korean',
tileGrid: new WMTSTileGrid({
origin: getTopLeft(projection.getExtent()),
resolutions: resolutions,
matrixIds: matrixIds,
tileSize: [256, 256]
}),
requestEncoding: 'KVP',
crossOrigin: 'anonymous'
/*
tileUrlFunction: (tileCoord) => {
const [z, x, y] = tileCoord;
const matrix = matrixIds[z];
const replacedUrl = templateUrl
.replace("{z}", matrix)
.replace("{x}", x)
.replace("{y}", y); // 여기서는 교환 안 함 — env 템플릿이 담당
console.log('++++++',replacedUrl)
return replacedUrl;
},
*/
});
let baseMap = new TileLayer({
wmtsSource.setTileUrlFunction((tileCoord) => {
const [z, x, y] = tileCoord;
const matrix = matrixIds[z];
console.log(templateUrl.replace("{z}", matrix).replace("{x}", x).replace("{y}", y));
return templateUrl
.replace("{z}", matrix)
.replace("{x}", x)
.replace("{y}", y);
});
return new TileLayer({
id: _id,
visible: true,
type: 'base',
type: "base",
source: wmtsSource,
zIndex: 0
zIndex: 0,
});
return baseMap;
},
getBaseMap: function (_id) {
let url = GisApp.VWORLD_URL;