iOS 10 MapKit上一层缩放问题 [英] iOS 10 MapKit previous layer zoom issue
本文介绍了iOS 10 MapKit上一层缩放问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在地图应用程序中工作,该地图应用程序在地图上呈现折线。我在缩放时遇到问题,它会将先前的折线保留在图块上。
I am working in a map application which renders a polyline over a map. I am having an issue when zooming, it keeps the previous polyline on the tile.
我试图强制重绘:
[self.mapView reloadInputViews];
[self.mapView.layer setNeedsDisplay];
[self.mapView setNeedsDisplay];
此外,我试图减慢变焦速度,但问题仍然存在:
Also I tried to slow the zoom speed, but the issue is still in there:
[MKMapView animateWithDuration:2
delay:0
usingSpringWithDamping:0.6
initialSpringVelocity:10
options:UIViewAnimationOptionCurveEaseOut
animations:^{
[self.mapView setVisibleMapRect:unionRectThatFits
edgePadding:UIEdgeInsetsMake(20, 10, 20, 10)
animated:YES];
}
completion: nil];
有人知道吗?
推荐答案
我在这里找到了解决问题的方法:如何在mapView更改时刷新MKOverlayRenderer
I found the resolution to the problem here: How to refresh an MKOverlayRenderer when mapView change
所以我添加了:
override var boundingMapRect: MKMapRect {
return MKMapRectWorld
}
到我的MKPolyline& MKCircle子类。
To my MKPolyline & MKCircle subclass.
这篇关于iOS 10 MapKit上一层缩放问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文