Select to view content in your preferred language

android wmtsLayer加载多图层的wmts服务显示不出来

371
2
03-28-2024 07:34 PM
婉君郭
New Contributor II

我使用arcgis-android:100.11.0的版本进行Android开发,用下面的代码加载多图层的wmts服务加载不出来,加载单图层的wmts就可以显示。抓包发现没有发起切片请求。是不支持加载多图层还是其他什么原因?

val url = "http://111.21.167.150:6006/iserver/services/map-XZQHLK/wmts100"
val wmtsLayer = WmtsLayer(url,"XZQHLK4326")
wmtsLayer.loadAsync()
wmtsLayer.addDoneLoadingListener {
if (wmtsLayer.loadStatus == LoadStatus.LOADED){
Log.e("wmtsLayer", "${wmtsLayer.name}--${wmtsLayer.id}")
}else{
Log.e("wmtsLayer","${wmtsLayer.loadError.cause}" )
}
}
map.basemap = Basemap(wmtsLayer)
mapview.map = map

 

0 Kudos
2 Replies
婉君郭
New Contributor II
0 Kudos
ChanganShi
Esri Contributor

We cannot access the URL you provide. A WMTS service can contain multiple layers in a hierarchy. A WMTS layer can be constructed directly with a URL to a service and the uniquely identifying name of the desired layer. Alternatively, a WMTS service can be used to programmatically explore the available layers and allow the user to choose layers at run time. So if  you have multiple layers to add, you have to add them by layer ID one by one.

0 Kudos