문제

iOS 용 Google지도 SDK를 사용하고 있습니다.사용자가지도에서 긴 언론을 누르면 핀을 떨어 뜨리려고합니다.아래 코드는 Controller.m 및 .h 파일에있는 것입니다.내가 누르거나 길게 누르면 (코드에서 그것을 변경하십시오), 콘솔에 기록 된 것을 얻지 못했습니다.그러나지도는로드 중입니다.모든 조언은?

Documentation : https : //developers.google.com/maps/documentation/ios/map

#import "MapWithinPinViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#import <UIKit/UIKit.h>

@interface MapWithinPinViewController ()

@end

@implementation MapWithinPinViewController {
    GMSMapView *mapView_;

}



- (void)viewDidLoad
{


    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6];
    mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
    mapView_.myLocationEnabled = YES;
    self.view = mapView_;

}


- (void)mapView:(GMSMapView *)mapView didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate {
    NSLog(@"You tapped at %f,%f", coordinate.latitude, coordinate.longitude);
}

@end
.

Controller.h 파일 :

#import <UIKit/UIKit.h>
#import <GoogleMaps/GoogleMaps.h>

@interface MapWithinPinViewController : UIViewController<GMSMapViewDelegate>

@end
.

도움이 되었습니까?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top