2016-07-03 5 views
0

Die c.map = self.map Zeile schlägt mit EXC_BAD_ACCESS fehl.Schlechter Zugang zur Anzeige eines Kreises in Google Map

Aus Dokumentation:

/** 
* The map this overlay is on. Setting this property will add the overlay to the 
* map. Setting it to nil removes this overlay from the map. An overlay may be 
* active on at most one map at any given time. 
*/ 
@property(nonatomic, weak) GMSMapView *GMS_NULLABLE_PTR map; 

- (void)showResult:(GMSPlace *)place { 
    self.place = place; 

    GMSCameraPosition *position = [[GMSCameraPosition alloc] initWithTarget:place.coordinate zoom:16 bearing:0 viewingAngle:0]; 
    [self.map setCamera:position]; 

    GMSCircle *c = [[GMSCircle alloc] init]; 
    c.radius = 75 * 1609.344; 
    c.fillColor = [UIColor blueColor]; 
    c.map = self.map; 

} 

Antwort

1

Sie müssen die Position GMSCircle mit CLLocationCoordinate2D wie diese

c.position = coordinate; // Some CLLocationCoordinate2D position 
c.map = self.map 

Auch fillColor mit weniger geben angeben alpha es Karte so zeigen auch.
Hoffe das wird dir helfen.

Verwandte Themen