firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

[FR] Bridge GeoPoint to CLLocationCoordinate2D

Open paulb777 opened this issue 3 years ago • 1 comments

Discussed in https://github.com/firebase/firebase-ios-sdk/discussions/9958

Originally posted by michaelscampbell June 27, 2022 I notice that the Firebase libraries bridge some types from Firebase to Swift. For example, Timestamp to Date. It would be helpful to me for Firebase to bridge GeoPoint to CLLocationCoordinate2D also.

In particular, when converting a Firebase document to a custom object using documentReference.document.data(as: type.self) I would like to be able to convert a Firebase GeoPoint field directly to a CLLocationCoordinate2D as part of the conversion process.

Today I have to store a GeoPoint in my model. I then have a computed variable of type CLLocationCoordinate2D based on that GeoPoint. The rest of my app references the CLLocationCoordinate2D. So this conversion would allow me to simplify my model in multiple places (each object that references a GeoPoint).

Both types store a latitude and longitude so the conversion between them might be straight forward.

paulb777 avatar Jun 28 '22 14:06 paulb777

This feature is not prioritized at this time, but it is being tracked internally by b/238020949.

ehsannas avatar Jul 04 '22 19:07 ehsannas