2013-03-15 61 views

回答

8

我不知道爲什麼你記下來,因爲我有同樣的問題。 經過許多研究和Saxon Druce的回答,我已經看到了Android SDK上的Circle,但在iOS中沒有。

---編輯---

有2個解決方案,在這裏: How to display a circle in GMSMapView

--- EDIT 2 ----

由於他的版本1.2.1(2013年4月23 ),Google Maps SDK for iOS會在他的Shapes中計算一個GMSCircle。

現在可以得出這樣的:

CLLocationCoordinate2D circleCenter = CLLocationCoordinate2DMake(37.35, -122.0); 
GMSCircle *circ = [GMSCircle circleWithPosition:circleCenter 
             radius:1000]; 

circ.fillColor = [UIColor colorWithRed:0.25 green:0 blue:0 alpha:0.05]; 
circ.strokeColor = [UIColor redColor]; 
circ.strokeWidth = 5; 
circ.map = mapView; 

here

+0

您好!不幸的是,我沒有找到解決方案,所以我繪製了具有大量頂點的多邊形。仍然希望谷歌在下一版SDK中集成這個功能 – hex 2013-03-21 08:16:36

+0

是的,它的計劃...但是當... – 2013-03-21 11:46:39

+4

從現在起谷歌地圖sdk for ios有圓圈類! https://developers.google.com/maps/documentation/ios/shapes?hl=ru – hex 2013-04-24 07:26:50