マップビューで5ポイント(配列内にある)を表示する必要があります。私は私のlog.LoopのArray値が完全に実行していたと注釈がadded.Thisを取得されていませんが示されている私のコードです:複数の注釈をマップビューで追加する方法
self.mapView.delegate = self
self.mapView.mapType = MKMapType.standard
self.mapView.isZoomEnabled = true
self.mapView.isScrollEnabled = true
self.mapView.showsUserLocation = true
print("LOCATION LIST==>>")
print(items["Location"].arrayValue)
for locationList in items["Location"].arrayValue
{
print(locationList)
let annotation = MKPointAnnotation()
annotation.coordinate = CLLocationCoordinate2D(latitude: locationList["latitude"].doubleValue, longitude: locationList["longitude"].doubleValue)
self.mapView.addAnnotation(annotation)
}
self.mapView.delegate = self
ログイン:
LOCATION LIST==>>
{
"Latitude" : 12.988415,
"Longtitude" : 80.218386
}, {
"Latitude" : 12.988445,
"Longtitude" : 80.21839199999999
}, {
"Latitude" : 12.988492,
"Longtitude" : 80.218422
}, {
"Latitude" : 12.988558,
"Longtitude" : 80.218461
},
{
"Latitude" : 12.991181,
"Longtitude" : 80.21950200000001
}
しかし、それは私の中に注釈が表示されませんマップビュー。事前にありがとうございます。
質問はスピーディーなコードなので、最初に見てからObjective-Cコードなしで答えてください。 –
確かに..それを正しく編集する –