drawMapRect:zoomScale:inContext:应该被调用多长时间?

时间:2016-07-20 21:15:49

标签: ios mkmapview mkoverlay

我有一个自定义的MKOverlayRenderer。我在第一次更改区域后(当它从默认位置移动到用户的位置时)向MKMapView添加MKOverlay(也是自定义)。渲染速度相当滞后,所以我记录了函数调用。

2016-07-20 14:03:21.486 MyApp[360:38679] mapView:regionDidChangeAnimated:
2016-07-20 14:03:22.351 MyApp[360:38679] addOverlay:level:
2016-07-20 14:03:22.353 MyApp[360:38679] mapView:rendererForOverlay:
2016-07-20 14:03:22.460 MyApp[360:38709] drawMapRect:zoomScale:inContext:
2016-07-20 14:03:22.460 MyApp[360:38706] drawMapRect:zoomScale:inContext:
2016-07-20 14:03:22.501 MyApp[360:38709] drawMapRect:zoomScale:inContext:
2016-07-20 14:03:22.504 MyApp[360:38706] drawMapRect:zoomScale:inContext:
2016-07-20 14:03:22.504 MyApp[360:38707] drawMapRect:zoomScale:inContext:
2016-07-20 14:03:22.560 MyApp[360:38707] drawMapRect:zoomScale:inContext:
2016-07-20 14:03:22.562 MyApp[360:38709] drawMapRect:zoomScale:inContext:
2016-07-20 14:03:22.582 MyApp[360:38713] drawMapRect:zoomScale:inContext:

这没有触及设备。是drawMapRect:zoomScale:inContext应该像这样重复调用吗?

1 个答案:

答案 0 :(得分:0)

  

drawMapRect:zoomScale:inContext应该像这样重复调用吗?

是。可见地图由瓷砖组成。每个磁贴调用一次drawMapRect:zoomScale:inContext:(如果您的实现实际上查看了传入的rect参数,就会知道。)