小编DJH*_*ard的帖子

防止MKMapView不断重新缩放并重新定位到用户位置

我似乎与许多发布在这里的人有相反的问题MKMapView.我似乎无法让它停止这样做,而不是无法让它缩放并显示当前位置.这是发生的事情:

  • 我启动了应用程序
  • MKMapView用蓝点显示我的位置
  • 我用手指在地图上缩小和缩小
  • 几秒钟后,MKMapView突然再次缩放到我当前位置的中心位置

我试图告诉我CLLocationManagerstopUpdatingLocation(没有任何影响,因为一个MKMapView知道如何使用CoreLocation),我尝试了告诉MKMapViewsetShowsUserLocation:NO(无蓝点显示在所有的,这不是我想要的).我甚至试图消除我的CLLocationManager(没有效果).造成这种情况的原因是什么?如何阻止它?


是的,我确实设置了位置管理员的准确性和距离-loadView.

我没有实施-mapViewDidFinishLoadingMap:.这是我的实施

-locationManager:didUpdateToLocation:fromLocation:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    // How many seconds ago was this new location created?
    NSTimeInterval t = [[newLocation timestamp] timeIntervalSinceNow];

    // CLLocationManagers will return the last found location of the device first,
    // you don't want that data in this case. If this location was …
Run Code Online (Sandbox Code Playgroud)

iphone location zooming mkmapview

11
推荐指数
1
解决办法
4200
查看次数

标签 统计

iphone ×1

location ×1

mkmapview ×1

zooming ×1