Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query not working if stored as GeoPoint #20

Open
michaeltheshah opened this issue Jun 28, 2019 · 3 comments
Open

Query not working if stored as GeoPoint #20

michaeltheshah opened this issue Jun 28, 2019 · 3 comments

Comments

@michaeltheshah
Copy link

I'm using GeoFirestore in both Android and iOS. With Android, to set a location the only option is to upload as a GeoPoint e.g. [0º N 0º E]. It looks like with iOS either a GeoPoint or an array of Double can be uploaded. This causes issues when querying since the iOS client is looking for an array of doubles.

internal func childAdded(_ snapshot: DocumentSnapshot?) {
        let lockQueue = DispatchQueue(label: "self")
        lockQueue.sync {
            
            let l = snapshot?.get("l") as? [Double?]
            if let lat = l?[0], let lon = l?[1], let key = snapshot?.documentID {
                let location = CLLocation(latitude: lat, longitude: lon)
                updateLocationInfo(location, forKey: key)
            }else{
                //TODO: error??
            }
            
        }
    }

This causes all queries to fail.

@michaeltheshah
Copy link
Author

Created a pull request to address this

@shijilsmb
Copy link

@mochat97 have you find any solution for this?

@michaeltheshah
Copy link
Author

@shijilsmb yeah I pushed a pull request that was merged. #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants