【发布时间】:2020-01-08 01:48:55
【问题描述】:
我的默认地图在 EPSG:5179 坐标系中,我正在使用 tileurlfunction 重新定义。
视图投影也设置为 5179。
将 Geoserver WMS 图层投影到 EPSG:4326 或 EPSG:3857 根据要求,它将覆盖在我的底图上。
但是如果我修改投影为EPSG:5179并覆盖tilegrid值,tileurlfunction,就不能正常覆盖了。
如果你看一下ol v6.0.0.md,
新的内部瓷砖坐标,好像是部分修改了tileUrlFunction导致的问题。
如果 tilegrid 不使用 Top-Left 并应用 Bottom-Left,如果您能告诉我如何进行 WMS 图层服务,将不胜感激。
- 我的baselayer&tileurl函数
tilegrid
origin: bottom-left,
resolutions,
extent
tileurlfunction
return (
(tileCoord) => {
if (!tileCoord) {
return undefined;
} else {
return template..replace(zRegEx, tileCoord[0].toString())
.replace(xRegEx, tileCoord[1].toString())
.replace(yRegEx, (-tileCoord[2] - 1).toString());
}
}
);
- 地理服务器 wmslayer
const tileGrid = new TileGrid({
origin: [extent[0], extent[1]],
resolutions,
extent
})
const wmsSource = new TileWMS({
url: 'http://domain/geoserver/wms',
params: { LAYERS: 'test:ecl_sw_p', TILED: true },
projection: 'EPSG:5179'
tileGrid
})
【问题讨论】: