在Google地图上显示圈子的访问权限不佳

时间:2016-07-03 02:58:10

标签: ios google-maps

c.map = self.map行因 EXC_BAD_ACCESS而失败。

来自文档:

/**
 * 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;

}

1 个答案:

答案 0 :(得分:1)

您需要使用GMSCircle指定CLLocationCoordinate2D的位置

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

同时为fillColor提供较少的alpha,以便显示地图。
希望这会对你有所帮助。