【Mars3d】使用WmtsLayer的时候TileMatrix没有带到TileMatrixset的前缀map_4326_16这种参数

发布时间:2023年12月21日

问题:

1.【Mars3d】使用WmtsLayer的时候TileMatrix没有带到TileMatrixset的前缀map_4326_16这种参数。

示例中的WmtsLayer的配置代码:

? // 方式2:在创建地球后调用addLayer添加图层(直接new对应type类型的图层类)

? tileLayer = new mars3d.layer.WmtsLayer({

? ? url: "//server.mars3d.cn/geoserver/gwc/service/wmts",

? ? layer: "mars:hfgh",

? ? format: "image/png",

? ? tileMatrixSetID: "EPSG:4326",

? ? crs: "EPSG:4326",

? ? alpha: 0.8,

? ? pickFeaturesUrl: "//server.mars3d.cn/geoserver/mars/wms",

? ? popup: "all",

? ? highlight: {

? ? ? type: "wallP",

? ? ? diffHeight: 100,

? ? ? materialType: mars3d.MaterialType.LineFlow,

? ? ? materialOptions: {

? ? ? ? image: "img/textures/fence.png",

? ? ? ? color: "#ffff00",

? ? ? ? speed: 10, // 速度,建议取值范围1-100

? ? ? ? axisY: true

? ? ? }

? ? },

? ? flyTo: true

? })

? map.addLayer(tileLayer)

我自己的wmtsLayer的代码:

结果:

1.正常的示例中的geoserver可以正常预览的页面F12请求的瓦片参数:

2.自己的wmts服务测试的请求的瓦片参数没有带到TileMatrixset的前缀map_4326_16这种参数:

3.正常的预览参数就是这个TileMatrix的层级加上TileMatrixset的前缀就可以实现正常请求,但是自己的服务没有这个请求。

解决方案:

1.尝试tileMatrixLabels参数

2.tileMatrixLabels参数的用法:

??tileMatrixLabels:?[...Array(20).keys()].map((level)?=>?("?map_4326_16"?+?level).toString()),

文章来源:https://blog.csdn.net/m0_69803146/article/details/135129924
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。