Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加载geoserver发布的wmts服务titlematrix错误 #2388

Closed
liangyuan1 opened this issue Sep 5, 2024 · 5 comments
Closed

加载geoserver发布的wmts服务titlematrix错误 #2388

liangyuan1 opened this issue Sep 5, 2024 · 5 comments
Assignees
Labels

Comments

@liangyuan1
Copy link

使用wmtssource 加载geoserver 发布的wmts服务,titlemaxtrix :直接返回数字,丢失 3857:类似的字段,如下图所示
image

@jailln
Copy link
Contributor

jailln commented Sep 5, 2024

Can you provide more details about your bug please ?

@liangyuan1
Copy link
Author

Can you provide more details about your bug please ?

实现代码:vue(2.6.14)
具体方法:
var orthoSource1 = new itowns.WMTSSource({
url: 'http://192.168.112.29:9090/geoserver2/cite/gwc/service/wmts?',
crs: 'EPSG:3857',
name: 'cite:csdmaWMTS3857',
tileMatrixSet: '3857',
format: 'image/png',
})
var orthoLayer1 = new itowns.ColorLayer('Ortho1', {
source: orthoSource1,
})
view.addLayer(orthoLayer1)
结果问题:(1)存在跨域,但是使用oepnlayer和cesium加载不存在,(2)瓦片请求地址不对,主要是TILEMATRIX字段,正确的应该是TILEMATRIX=tileMatrixSet+“:”+tileMatrixSet
image

@AnthonyGlt
Copy link
Contributor

Hello, why would we have the tileMatrixSet in the tileMatrix ? This info is already carried in the tileMatrixSet.
Do you have a spec for this ?
Thank you

ALSO, you must type in English so it makes it easier for everyone involved in this project ( english isn't my primary language neither ;) )

@liangyuan1
Copy link
Author

Hello, why would we have the tileMatrixSet in the tileMatrix ? This info is already carried in the tileMatrixSet. Do you have a spec for this ? Thank you

ALSO, you must type in English so it makes it easier for everyone involved in this project ( english isn't my primary language neither ;) )

This is the rule for publishing services on Geoserver. Geoserver is an open-source map server that is widely used

@airnez
Copy link
Contributor

airnez commented Jan 31, 2025

Hi,
Geoserver does indeed format tileMatrixSet identifiers this way. You can use the tileMatrixCallback parameter to adress this problem : tileMatrixCallback: (zoomLevel => "3857:" + zoomLevel).

let orthoSource1 = new itowns.WMTSSource({
url: 'http://192.168.112.29:9090/geoserver2/cite/gwc/service/wmts?',
crs: 'EPSG:3857',
name: 'cite:csdmaWMTS3857',
tileMatrixSet: '3857',
format: 'image/png',
tileMatrixCallback: (zoomLevel => "3857:" + zoomLevel)
});

@jailln jailln closed this as completed Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants