【发布时间】:2014-12-05 18:51:19
【问题描述】:
我注意到当我将示例的最大缩放级别设置为 19 时,缩放上升到 20。我不知道为什么。 它总是比我设置的缩放级别高 1 级。
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];
};
【问题讨论】:
标签: ios google-maps google-maps-api-3