2016-12-02 2 views

ответ

1

Создать подвид и определите класс подвид под GMSMapView

enter image description here

- (void)LoadMap { 

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

// Creates a marker in the center of the map. 
GMSMarker *marker = [[GMSMarker alloc] init]; 
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20); 
marker.title = @"Sydney"; 
marker.snippet = @"Australia"; 
marker.map = mapView_; 

// this line add subView 
[self.view addSubview : mapView_ ]; } 
Смежные вопросы