Map does not display

673
2
09-13-2021 01:30 AM
雪原高
New Contributor

Hello, I added layers according to the method you said, but the map could not be displayed on the APP. Could you please check the reason?

0 Kudos
2 Replies
Nicholas-Furness
Esri Regular Contributor

Your code looks like it's doing the right things but I can't tell what's going wrong based off that screenshot. Is TianDiTuWMTSLayer a subclass of AGSWMTSLayer? How are you instantiating the AGSWMTSLayer superclass from within your initializer? What are the services being accessed?

The first screenshot shows an authentication challenge from ArcGIS.com. Is that expected? Where are your two map layers hosted?

I expect there's something failing on map load, or the service isn't responding as expected. You can find out more by calling load on your AGSMap and seeing if there's an error on map load. That could help you home in on the problem.

You can also use AGSRequestConfiguration to output debug logs to the console. Get the singleton globalConfiguration and set debugLogResponses to true.

Hope that helps.

0 Kudos
Ting
by Esri Contributor
Esri Contributor

Hi,

It seems the operational layers aren't added to the map correctly. Could you check if your 天地图 layers are reachable?

 

你好,

在第一张截图里面的登录弹窗里,您是否提供了正确的用户名密码?

如果您访问的layer不是公开的,则需要登录才能加载。

 

另外,从截图里看代码有如下(潜在的)问题

1. AGSMap的basemap没有设定

2. AGSMapView的背景色被设成了灰色

3. 如果两个天地图layer之一为nil,则二者均不会被加到map上。可以尝试去掉nil的判断,或者打断点测试layer是否初始化成功

4. 有关API key、OAuth等鉴权问题,请参考这个文档中的说明

0 Kudos