GMSMapViewに円を表示する必要があります(MKCircleと同様)。これは、MKMapViewとMKCircleを使用すると簡単ですが、GMSMapViewでMKCircleを使用することはできません。 アイデアGMSMapViewでサークルを表示する方法
更新:
1円形画像を含む地上マーカー:
これは現在(2013年3月18日)のオプションです。
2.いくつかのセグメント(ポリライン)で作成された円。
編集:
3. GoogleはそれがOKに見える円形画像40×40ピクセルの場合GMSCircle(2013年4月23日)
GMSGroundOverlayOptions *overlayOptions = [GMSGroundOverlayOptions options];
overlayOptions.icon = [UIImage imageNamed:@"circle"];
overlayOptions.position = touchMapCoordinate;
overlayOptions.bearing = 0;
overlayOptions.zoomLevel = 14.3;
[mapView addGroundOverlayWithOptions:overlayOptions];
を追加しました。 (半径が約100メートルである)
小セグメント化されたパスの溶液:
GMSPolylineOptions *circle = [GMSPolylineOptions options];
CGPoint touchPoint = [mapView.projection pointForCoordinate:touchMapCoordinate];
GMSMutablePath *path = [GMSMutablePath path];
CGPoint circlePoint;
for (int i = 0; i < 360; i++)
{
circlePoint.x = touchPoint.x + radius * cos(i*M_PI/180);
circlePoint.y = touchPoint.y + radius * sin(i*M_PI/180);
CLLocationCoordinate2D aux = [mapView.projection coordinateForPoint:circlePoint];
[path addCoordinate:aux];
}
circle.path = path;
circle.width = 1;
[mapView addPolylineWithOptions:circle];
EDIT:2013年5月8日
GMSCircle溶液:
CLLocationCoordinate2D circleCenter = CLLocationCoordinate2DMake(latitude, longitude);
GMSCircle *circ = [GMSCircle circleWithPosition:circleCenter
radius:1000];
circ.fillColor = [UIColor blueColor];
circ.strokeColor = [UIColor redColor];
circ.strokeWidth = 5;
circ.map = mapView;
は、あなたがこれまでにしようとしているものを公開することはできますか? – Noich
私はどのように始めるか分かりません。 GMSGroundOverlayとGMSGroundOverlayOptionsを使用して円のアイコンを追加することを考えましたが、これは円が常に特定の半径を持つことを意味します。 – Bogus
iOS 8で動作しません –