首页 / 浏览问题 / 云GIS / 问题详情
WMTS服务GetCapabilities请求
142EXP 2019年08月12日
这个GetCapabilities 请求是直接在wmts服务地址后 加上 ?SERVICE=WMTS&VERSION=version&REQUEST=GetCapabilities

那我应该怎么定义一个function获取响应结果中的layer和tilematrixSet,构成数组?  通过ajax的话会报错误,报错信息如下

" http://127.0.0.1:8090/iserver/services/map-SMCSData/wmts100?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'http://127.0.0.1:8860' is therefore not allowed access.”

1个回答

" http://127.0.0.1:8090/iserver/services/map-SMCSData/wmts100?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'http://127.0.0.1:8860' is therefore not allowed access.”

这个是跨域问题,可以查一下CSDN或者百度相关的文章。然后定义function获取响应结果这个需要自己通过百度查找相关的方法去实现,只要能获取到响应结果就可以通过查询或者其他办法获取到layer这个参数的值和tilematrixSet的值。

其实这种方法相比较而言会比你自己去在WMTS里找到所有的值,去填写参数要复杂,要通过自定义函数实现功能
5,668EXP 2019年08月12日
...