iOS谷歌地图SDK:设置maxZoom级别问题
我注意到,当我将“示例”的“最大缩放级别”设置为19时,缩放将上升到20。我不知道为什么。 它总是比我设置的缩放级别多1个缩放级别iOS谷歌地图SDK:设置maxZoom级别问题,ios,google-maps,google-maps-api-3,Ios,Google Maps,Google Maps Api 3,我注意到,当我将“示例”的“最大缩放级别”设置为19时,缩放将上升到20。我不知道为什么。 它总是比我设置的缩放级别多1个缩放级别 GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:23.589571946369546 longitude:58.14204730042655
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:23.589571946369546
longitude:58.14204730042655
zoom:16];
self.mapView_.camera=camera;
self.mapView_.myLocationEnabled = YES;
self.mapView_.mapType = kGMSTypeHybrid;
self.mapView_.settings.compassButton = YES;
[self.mapView_ setMinZoom:5 maxZoom:19];
// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(23.168520, 58.008163);
marker.map = self.mapView_;
// ------ add layer
// Implement GMSTileURLConstructor
// Returns a Tile based on the x,y,zoom coordinates, and the requested floor
GMSTileURLConstructor urls = ^(NSUInteger x, NSUInteger y, NSUInteger zoom) {
NSString *url = [NSString stringWithFormat:@"http://www.example.com/%tu/%tu/%tu.png", zoom, x, y];
NSLog(@"url=%@",url);
return [NSURL URLWithString:url];
};
你怎么知道maxZoom是20?您使用哪个版本的iOS地图SDK 我使用iOS Maps SDK 1.9.1版尝试了Google Maps的Github页面中的示例,并将下面的代码放入videDidLoad()方法中。它将打印正确的最大缩放比例,即19
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:23.589571946369546
longitude:58.14204730042655
zoom:16];
mapView_.camera=camera;
mapView_.myLocationEnabled = YES;
mapView_.mapType = kGMSTypeHybrid;
mapView_.settings.compassButton = YES;
// Create the GMSMapView with the camera position.
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
[mapView_ setMinZoom:5 maxZoom:19];
NSLog(@"max zoom: %f", mapView_.maxZoom);
谢谢@ztan。。。让我再检查一下。也许我搞错了。我又在think link上发布了同样的问题。。请检查。。。