0
我必须在我的地图视图中显示5个点(位于数组中)。我已经表明我的log.Loop数组值运行完美和注释都没有得到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
}
但它没有显示我的注解地图View.Thanks提前。
问题在swift代码中,所以您应该先看看,然后在没有Objective-C代码的情况下回答。 –
哦,当然..编辑它权利awat –