小编str*_*x86的帖子

如何从谷歌地图获取当前缩放级别的ios?

我使用具有数字值的方法相机,如下所示:

camera = [GMSCameraPosition cameraWithLatitude:37.35 longitude:-122.0 zoom:6];
Run Code Online (Sandbox Code Playgroud)

我需要通过计时器自动重绘当前位置的地图:

-(void)gmapRedraw{
    NSLog(@"gmapRedraw");
//    self.MapView.camera
    [locationManager startUpdatingLocation];
    NSLog(@"lat %f, lon %f", locationManager.location.coordinate.latitude, locationManager.location.coordinate.longitude);
    camera = [GMSCameraPosition cameraWithLatitude:locationManager.location.coordinate.latitude//37.36//-37.81319//-33.86
                                         longitude:locationManager.location.coordinate.longitude//-122.0//144.96298//151.20
                                              zoom:6];
    self.MapView.camera = camera;
}

-(void)timer{
    [NSTimer scheduledTimerWithTimeInterval:0.5
                                     target:self
                                   selector:@selector(gmapRedraw)
                                   userInfo:nil
                                    repeats:YES];
}
Run Code Online (Sandbox Code Playgroud)

但如果我通过触摸改变它,我怎么能得到当前的变焦?

google-maps zoom cllocationmanager ios

18
推荐指数
3
解决办法
2万
查看次数

标签 统计

cllocationmanager ×1

google-maps ×1

ios ×1

zoom ×1