1
A
回答
2
你可以只畫2個折線與相同的路徑。
假設您已創建了具有緩衝座標的變量thePath
。 您已經使用此路徑創建了折線。
let redPolyline = GMSPolyline()
redPolyline.path = thePath
redPolyline.map = mapview
創建另一個。
let redPolyline = GMSPolyline()
redPolyline.path = thePath
redPolyline.strokeWidth = 6.0 // Change it accordingly
redPolyline.strokeWidth = UIColor.redColor().colorWithAlphaComponent(0.5) // Change it accordingly
redPolyline.map = mapview
記住這redPolyline的zIndex
應該比bluePolyline高,因爲我可以根據您提供的圖片中看到,redPolyline是另一個的上面。
+0
是的,但它不是很正確的決定。我需要設置繪製該多邊形的距離,因爲我需要添加更多的點(Google地方),這是在小區域(例如20公里) 此決定何時接近polilayn區域也減少(( ) Java和Java腳本有解決方案https://github.com/dr-jts/jts/tree/master/modules/core/src/main/java/org/locationtech/jts/operation/buffer –
0
If you want to draw polygone on Google map with array coordinates use this function:
func addPloygone(){
let path = GMSMutablePath()
path.removeAllCoordinates()
for i in places{
path.add(CLLocationCoordinate2D(latitude:i.lon!, longitude:i.lat!))
let polyline = GMSPolygon(path: path)
polyline.geodesic = true
polyline.map = map
polyline.strokeColor = UIColor.black
polyline.fillColor = UIColor.init(colorLiteralRed:176/255, green: 143/255, blue:52/255, alpha: 0.6)
}
}
相關問題
- 1. 多邊形與半徑的折線?
- 2. 周圍畫一個多邊形
- 3. 創建一定半徑的多邊形
- 4. PHP計算多段線周圍的多邊形
- 5. 帶邊框半徑的多線圓角
- 6. 圍繞折線創建一個多邊形,如緩衝區
- 7. 如何獲得點周圍的邊界多邊形?
- 8. 計算多邊形周圍的Voronoi
- 9. 多邊形周邊
- 10. WPF -HitTest半徑折線/路徑
- 11. 如何在pictureBox1邊框周圍畫一個矩形?
- 12. 在多個其他多邊形的某個半徑內查找多邊形
- 13. QGIS折線多邊形錯誤
- 14. CSS如何使內部的div邊框半徑與外層div邊框半徑
- 15. 如何降低迅速IOS
- 16. 如何從IOS迅速
- 17. 多線程在迅速
- 18. 問題與邊界半徑
- 19. 如何刪除ExtJS中摺疊標題周圍的邊距
- 20. 刪除標記周圍的多邊形/圓形?
- 21. 在橢圓形的圖畫框周圍繪製邊框
- 22. 移除拐角半徑處的陰影/邊界線iOS
- 23. CSS3 - 如何在矩形上創建圓形邊框半徑?
- 24. 畫布周圍不需要的邊框
- 25. D3js - 圓形位置與圓弧或曲線路徑的半徑
- 26. 算法 - 如何圍繞多段線構建多邊形
- 27. 如何在WPF中的多個形狀周圍獲取單個邊界矩形
- 28. CSS3縮放動畫帶邊框半徑
- 29. iOS-與圓心和半徑
- 30. iOS retina safari bug渲染邊框半徑?
難道你不能再用不同的顏色和更大的線寬再繪製多重線嗎? – Fogmeister