Open russellbarnes opened 10 years ago
I've come across this as well; I've been looking for some kind of location found completion block, but haven't found one yet.
You could do key-value observing on a currentLocation property. That's how we did it in Transport
We're using CLLocationManager
, so I think we'll use the CLLocationManagerDelegate
alongside some sort of BOOL
or something. We're not guaranteed to have an instance of a GMSMapView
(once we implement caching the map view images instead of showing the actual map view), so we can't use the myLocation
property on there either.
Discovered via TestFlight that sometimes, the request to server happens before a proper location lock is obtained, which makes a request to the server for stops near lat=0, long=0 and results in an empty list.
How to fix: wait until location lock is obtained before loading data from server. At worst, check if lat & long are 0.