I have the following code which retrieves coordinates I have stored in Google Firestore:
let locationsRef = db.collection("locatioInfo")
locationsRef.getDocuments { (querySnapshot, err) in
if let err = err {
print("Error receiving Firestore snapshot: \(err)")
} else {
for document in querySnapshot!.documents {
print("\(document.documentID) => \(document.data())")
}
}
}
which produces this output:
location1 => ["geopoint": <FIRGeoPoint: (50.086421, 14.452333)>]
location2 => ["geopoint": <FIRGeoPoint: (50.086442, 14.452268)>]
My question is: how do I transform those fetched FIRGeoPoints into CLLocationCoordinates2D or simply: how can I use these coordinates and show them on the map?
I have a MKAnnotationView already set-up ad used it for hard-coded coordinates, now I need to display the fetched ones. Hopefully this is clear enough, thanks in advance.