Jon*_*des 10 iphone mapkit ios ios10
我正在地图应用程序中工作,该应用程序在地图上呈现折线.我在缩放时遇到问题,它会将先前的折线保留在图块上.
我试图强制重绘:
[self.mapView reloadInputViews];
[self.mapView.layer setNeedsDisplay];
[self.mapView setNeedsDisplay];
Run Code Online (Sandbox Code Playgroud)
我也尝试减慢变焦速度,但问题仍然存在:
[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];
Run Code Online (Sandbox Code Playgroud)
有谁知道这个?
PJe*_*ouf -1
我在这里找到了问题的解决方案:How tofresh an MKOverlayRenderer when mapView change
所以我补充道:
override var boundingMapRect: MKMapRect {
return MKMapRectWorld
}
Run Code Online (Sandbox Code Playgroud)
到我的 MKPolyline 和 MKCircle 子类。
| 归档时间: |
|
| 查看次数: |
887 次 |
| 最近记录: |