2014-12-05 4 views
1

예제의 최대 확대/축소 수준을 19로 설정하면 확대/축소가 최대 20까지 증가합니다. 그 이유는 알지 못합니다. 항상 설정 한 것보다 1 배 더 줌 레벨입니다.iOS Google지도 SDK : maxZoom 수준 설정 문제

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]; 
}; 

답변

2

maxZoom이 20임을 어떻게 알 수 있습니까? 어떤 버전의 iOS지도 SDK를 사용하십니까?

Google지도의 Github 페이지에서 iOS Maps SDK 버전 1.9.1을 사용하여 샘플 hello map application을 시도하고 아래 코드를 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); 
+0

감사합니다. @ztan ... 다시 확인하겠습니다. 어쩌면 실수를 한 것일 수도 있습니다. – user836026

+0

나는 생각 링크에 같은 문제를 다시 게시했습니다. 확인해주세요 ... http://stackoverflow.com/questions/27606375/ios-google-map-sdk-setting-maxzoom-level-issue-when-using-tiles – user836026

관련 문제