夥計們,我一直在做這個項目有關谷歌的地方和地圖apis。 我想要做的是搜索最近的餐館。但我不能在地圖上放置多個圈子。在地圖上爲用戶的當前位置顯示一個標記。這是代碼。谷歌地圖多個圈子
func setUpMarkersForLibraries(locations: [CLLocationCoordinate2D]){
print("Setting up Markers")
var i = 0
for l in locations{
let circleCenter = l
let circ = GMSCircle(position: circleCenter, radius: 30)
circ.fillColor = UIColor(red: 0, green: 0.89, blue: 0, alpha: 0.8)
circ.strokeColor = .black
circ.strokeWidth = 5
circ.title = "\(i)"
circ.map = mapView
}
}
我通過了我開始使用谷歌Places API的網絡服務的所有位置的座標。所以總共有20個地點,所以應該有20個標記。但沒有。請讓我知道我做錯了什麼。謝謝。
你是否將你的mapview添加到你的視圖? self.view = mapView –
是的,我在我的viewDidLoad方法中這樣做。 –
@AnonyTaylor可能是什麼問題? –