firebase / geofire-objc

GeoFire for Objective-C - Realtime location queries with Firebase
MIT License
436 stars 180 forks source link

Geofire crashes when query with large region. #91

Closed CoderXpert closed 5 years ago

CoderXpert commented 7 years ago

I have an app where the user can scroll the map to get more annotation pins. I am using fire region query to get the data. However, if the user zooms out too much that whole world is in the map geo fire crashes the app with invalid location error. Below are the logs. I think when mapping region out farther than a pole app crashes.

Is there any fix or work around available? Or I have to manually apply fence.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Not a valid Geo location: [91.561327,-13.144847]'
mikeCalvir commented 7 years ago

Hey I was just scanning the issues to see if this library is still ok and noticed this one. Just to say that the clue is in the error - you're passing in a center coordinate that doesn't exist :) Your coordinate is beyond the north pole and into an imaginary realm.

So in that case the error seems like the only rational response.

morganchen12 commented 5 years ago

Closing since this issue has staled.

We could consider adding more fine-grained query behavior so users can specify "clamp my coordinates if they're too large" and just query with arbitrarily large numbers as coordinates, but I can't think of a reasonable use case for querying an entire hemisphere at a time. If you do have one, please comment here.