iOS 10 MapKit previous layer zoom issue

ε祈祈猫儿з 提交于 2019-12-31 13:55:14

问题


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.

I have tried to force redrawing:

[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];

Does anyone know about this?


回答1:


I found the resolution to the problem here: How to refresh an MKOverlayRenderer when mapView change

So I added:

override var boundingMapRect: MKMapRect {

    return MKMapRectWorld
}

To my MKPolyline & MKCircle subclass.



来源:https://stackoverflow.com/questions/40087736/ios-10-mapkit-previous-layer-zoom-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!