2010-12-14 7 views
1

m 내 Google 맵 마커에 대한 뷰포트를 설정하는 방법을 알기 쉽지 않습니다.iphone에서 googlemap 뷰포트 사용자 정의

objC에서 수행 할 수있는 방법은 무엇입니까 ??

또는 내지도 자체에서해야합니까 ??? 그렇다면, 어떻게?

구글지도에 대한 나의 코드를 그냥 마커와 함께지도를 보여 주지만, 내가 그것을 클릭하면, 그냥 작은 상자에있는 장소의 이름을 표시합니다 .. :(그것은 적절한에게

을 만드는 방법을

alt text

답변

1

1) 당신은 MKAnnotationView을 하위 클래스 : 뷰포트 ???

여기 뷰포트의 이미지입니다. 나는 그것이 당신의 문제를 해결하는 가장 좋은 방법이라고 생각합니다.

2) 당신은 예를 들어, 귀하의 주석 콜 아웃 뷰를 사용자 정의 할 수 있습니다 :

- (MKAnnotationView *) mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation { 
    static NSString* ItemAnnotationIdentifier = @"itemAnnotationIdentifier"; 
    MKPinAnnotationView* pinView = (MKPinAnnotationView *) 
            [theMapView dequeueReusableAnnotationViewWithIdentifier:ItemAnnotationIdentifier]; 
    if (!pinView) 
    { 
     // if an existing pin view was not available, create one 
     MKPinAnnotationView* customPinView = [[[MKPinAnnotationView alloc] 
              initWithAnnotation:annotation 
              reuseIdentifier:ItemAnnotationIdentifier] 
              autorelease]; 
     customPinView.canShowCallout = YES; 

     UIImage *logo = [ImageProcessor scaleImage:[UIImage imageNamed:@"logo.png"] toSize:CGSizeMake(30, 30)]; 
     customPinView.leftCalloutAccessoryView = [[[UIImageView alloc] initWithImage:logo] autorelease]; 

     UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; 
     rightButton.tag = [((ItemAnnotation *)annotation).itemId intValue]; 
     [rightButton addTarget:self 
         action:@selector(showDetails:) 
      forControlEvents:UIControlEventTouchUpInside]; 
     customPinView.rightCalloutAccessoryView = rightButton;  

     return customPinView; 
    } 
    else 
    { 
     pinView.annotation = annotation; 
    } 
    return pinView; 
} 
+0

내가 Google지도 있습니다 ABT 질문 ... 어쨌든 난 당신의 개념을 구현하고 나는 그것을 가지고 .. :) 감사합니다. .. :) – Hisenberg

+0

당신은 환영합니다 :) – knuku