【发布时间】:2014-12-23 01:14:34
【问题描述】:
我注意到,当我将示例的最大缩放级别设置为 19 时,当我使用图块时,缩放会增加到 20。我不知道为什么。它总是比我设置的缩放级别高 1。
见下面的例子(这个来自 Google SDKDemo Example,我只是把 URL 改成指向我的域):
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:23.614328
longitude:58.545284
zoom:18];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
[mapView_ setMinZoom:5 maxZoom:19];
//mapView_.buildingsEnabled = NO;
//mapView_.indoorEnabled = NO;
mapView_.mapType = kGMSTypeHybrid;
self.view = mapView_;
tileLayer_.map = nil;
// Create a new GMSTileLayer with the new floor choice.
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];
};
tileLayer_ = [GMSURLTileLayer tileLayerWithURLConstructor:urls];
tileLayer_.map = mapView_;
现在,如果我继续放大。我会打印日志:
2014-12-22 20:06:02.342 SDKDemos[1792:941894] 网址:http://www.example.com/20/694778/453520.png
注意,域后的缩放级别是 20,但我将其设置为 19。 请注意,我使用的是 Google SDK 1.9 版
【问题讨论】:
标签: ios google-maps