MKMapView无法加载具有HTTP 410错误的切片 [英] MKMapView fails to load tiles with HTTP 410 error

查看:150
本文介绍了MKMapView无法加载具有HTTP 410错误的切片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到 MKMapView 的问题。放大时,地图无法加载切片。

I have a problem with MKMapView. Map fails to load tiles when I zoom it in.

-(void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error 

错误:


Domain = GEOErrorDomain Code = -204(null)UserInfo = {SimpleTileRequesterUnderlyingErrors =(
Error Domain = GEOErrorDomain Code = -204 \(null)\
UserInfo = {HTTPStatus = 410,
NSErrorFailingURLStringKey = HTTP:// gspe19。 ls.apple.com/tile.vf?flags=1&style=20&size=2&scale=0&v=11037825&am磷; Z = 15&安培; X = 6205&安培; Y = 12336&安培; SID = 0246704635757302674107153038443966765357&安培; ACCESSKEY = 1454685602_q3bVUYvHBdxsSo0A_j0fK7EyQ9b21NPShV7GRLzr4WFkkhxB4vO7%2BlXcGsXJ4zZHvhTaLVWsyPa3PlU60cDrmrFwmwCYBGrLA9mChV%2FHoRHoTU9AGI72VQP9UKZW%2B0GKqfRhpcw4xr%2F%2FTTVgJZ7wU4U4KnA8K2rVVQ%2FOfFHJq7OO4nYecTvy0ur4I9D3Sxf%2Btn9DcXU8agDRJignB }的,...

编辑:
好​​像它与缓存有某种关系,但我不确定。在地图应用程序中加载相同的地图区域后,此问题会消失一段时间。

Seems like it is related to cache somehow, but I'm not sure. This problem disappears for some time after loading the same map region in Maps application.

提前致谢

推荐答案

我在Apple开发者论坛上分析并描述了这个问题: https://forums.developer.apple.com/thread/43077

I analysed and described the problem on Apple developer forum: https://forums.developer.apple.com/thread/43077

iOS上的MapKit存在问题 - 地图有时无法加载,另一次是部分加载,显示无法加载的图块的普通网格。即使在Apple Maps应用程序中,每个使用MapKit的应用程序都会在系统范围内出现问题。 iPhone(6+)和iPad(iPad Air,iPad Air 2,iPad Mini)和一系列iOS版本(9.0,9.0.2,9.2.1)都会出现问题。此外,当地图缩放很高时,似乎更经常发生。问题很难重现,因为它看起来是随机发生的,在受影响的设备上持续一段时间并突然消失。

There is a problem with MapKit on iOS - map sometimes fails to load, another time it loads partially, displaying plain grid for a tile which failed to load. The problem happens systemwide in every app that uses MapKit, even in Apple Maps app. The problem happens on both iPhones (6+) and iPads (iPad Air, iPad Air 2, iPad Mini) and a range of iOS versions (9.0, 9.0.2, 9.2.1). Furthermore it seems to happen more often when map zoom is high. The problem is very hard to reproduce, because it looks to happen randomly, persists on affected device for some time and suddenly disappears.

我设法分析网络流量并发现可能这种奇怪行为的原因。与丢失的磁贴相关联的网络请求失败,HTTP状态码410和空内容:

I managed to analyse network traffic and found possible reason of this strange behaviour. Network requests associated with missing tiles fail with HTTP status code 410 and empty content:

GET http://gspe19.ls.apple.com/tile.vf?flags=1&style=13&size=2&scale=0&v=11040322&z=15&x=17923&y=10756&sid=SOME_SID_1&accessKey=SOME_ACCESS_KEY_1 <- 410  
GET http://gspe19.ls.apple.com/tile.vf?flags=1&style=20&size=2&scale=0&v=11040322&z=15&x=17923&y=10756&sid=SOME_SID_1&accessKey=SOME_ACCESS_KEY_1 <- 410  
...  

'v'参数似乎是地图版本号并随时间增长。看起来版本号可以在geo_manifest网络呼叫之后发生变化,这种情况经常发生:

'v' parameter seems to be a map version number and grow with time. It looks that the version number can change after a 'geo_manifest' network call, which happens from time to time:

GET https://gspe35-ssl.ls.apple.com/geo_manifest/dynamic/config?application=geod&application_version=1&country_code=PL&hardware=iPad4,2&os=ios&os_build=13C75&os_version=9.2  

下载新的geo_manifest后,版本号再次变为有效,并且每个磁贴请求都以HTTP状态码200成功结束:

After downloading new geo_manifest, version number becomes valid once again and every tile request ends successfully with HTTP status code 200:

GET http://gspe19.ls.apple.com/tile.vf?flags=1&style=13&size=2&scale=0&v=11040529&z=15&x=17923&y=10756&sid=SOME_SID_2&accessKey=SOME_ACCESS_KEY_2 <- 200  
GET http://gspe19.ls.apple.com/tile.vf?flags=1&style=20&size=2&scale=0&v=11040529&z=15&x=17923&y=10756&sid=SOME_SID_2&accessKey=SOME_ACCESS_KEY_2 <- 200  
...  

我用了一个lld b确认,陈旧的geo_manifest是410响应的原因。我在使用Xcode显示症状的设备上运行了一个任意应用程序。 MKMapView上缺少一些图块,网络流量中出现410个响应。我关闭了地图,暂停了lldb的执行,执行了一个私有的GeoService框架方法,似乎强制geo_manifest更新:

I used an lldb to confirm, that a stale geo_manifest is the reason of 410 responses. I ran an arbitrary app on device that showed the symptoms using Xcode. Some tiles were missing on a MKMapView, and 410 responses appeared in network traffic. I closed the map, paused execution with lldb, executed a private GeoService framework method that seemed to force geo_manifest update:

(lldb) po [[GEOResourceManifestManager sharedManager] forceUpdate]  

恢复执行后,geo_manifest更新请求出现在网络流量中。打开地图视图后,出现成功的切片响应并且地图已完全加载。看起来com.apple.geod守护程序本身无法不时地查询新的geo_manifest。因为问题是如此短暂,所以无法在设备控制台日志中找到任何com.apple.geod错误。

After resuming execution, geo_manifest update request appeared in network traffic. After opening map view, successful tile responses appeared and map was fully loaded. Looks like com.apple.geod daemon itself fails to query for new geo_manifest from time to time. Because the problem is so ephemeral, it was impossible to find any com.apple.geod errors in device console logs.

出现以下问题:为什么com.apple.geod ,当tile请求导致410响应时,GeoServices或MapKit不会尝试查询新的geo_manifest?这是一个已知问题吗? Apple计划在未来的iOS版本中修复此问题吗?

Following questions arise: why do com.apple.geod, GeoServices or MapKit not try to query for new geo_manifest when tile request results in 410 response? Is that a known issue? Does Apple plan to fix this in future iOS versions?

编辑:
已在iOS 10中修复( https://openradar.appspot.com/radar?id=6075032430182400

这篇关于MKMapView无法加载具有HTTP 410错误的切片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆