firebase / firebase/firebase-ios-sdk

[FR] Bridge GeoPoint to CLLocationCoordinate2D

Open
#9,961 1 comment 4 reactions 0 assignees View on GitHub
api: firestore Swift API type: feature request
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 14h
Merged PRs (30d)
72

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.