简体   繁体   English

超过maximumZ后MKTileOverlay瓷砖消失

[英]MKTileOverlay Tiles disappear after exceeding maximumZ

The tiles are loaded from disk via loadTileAtPath / URLForTilePath with a subclassed MKTileOverlay .这些图块是通过loadTileAtPath / URLForTilePath和子类化的MKTileOverlay从磁盘加载的。

When setting the maximumZ of the overlay, tiles beyond that level are (as expected) no longer loaded.设置叠加层的maximumZ时,超出该级别的图块(如预期)不再加载。 However, the tiles of the level above also disappear.然而,上面一层的瓷砖也消失了。 Any ideas?有任何想法吗?

It's been a while for me, but I had some issues with this in the past.这对我来说已经有一段时间了,但过去我遇到了一些问题。 I think it could be something with the internal caching or the overlays.我认为这可能与内部缓存或覆盖有关。

For example, if it happens to be the case that the tiles disappear at the transition from zoom level 20 to zoom level 21, and it is also the case that your tile source has a maximum zoom level of 20, then the behavior you're seeing could be a result of polylines invalidating portions of MKMapView's rendered tile cache.例如,如果碰巧在从缩放级别 20 到缩放级别 21 的过渡时瓷砖消失,并且你的瓷砖源的最大缩放级别为 20,那么你的行为看到可能是折线使 MKMapView 渲染图块缓存的部分无效的结果。

It could be that what you're seeing might be happening because your tile source doesn't provide tiles at a high enough zoom level for the amount of zooming you're attempting to do.您所看到的可能是因为您的图块源没有提供足够高的缩放级别的图块来满足您尝试进行的缩放量。 Normally Apple's MKMapView render cache provides some limited overzooming, but when you do something that triggers a new render (like adding lines), the render cache gets invalidated and the pseudo-overzooming stops working.通常,Apple 的 MKMapView 渲染缓存提供了一些有限的过度缩放,但是当您执行某些触发新渲染的操作(例如添加行)时,渲染缓存将失效并且伪过度缩放停止工作。

However, I also once saw a fix simply by changing the level for the overlay, Changed from "MKOverlayLevelAboveLabels" to [mapView addOverlay:overlay level:MKOverlayLevelAboveRoads];但是,我也曾经通过更改叠加层的级别看到了一个修复,从“MKOverlayLevelAboveLabels”更改为 [mapView addOverlay:overlay level:MKOverlayLevelAboveRoads];

I hope these suggestions can get you a bit further :)我希望这些建议能让你更进一步:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM