This PR calculates the user's distance to the reaches when their location is updated. Formerly, this update was only happening if the user's location got updated on the map view.
The code is a bit hacky. The constraints are:
lat/lng are stored as Strings instead of numbers, which makes comparison and calculations costly.
the distances are updated to core data.
Both of these constraints make it difficult to do this calculation quickly. Ideally, we would perform this calculation at the time it's needed (on the run list or map view controller). If we end up ripping out core data, we can change the data types, and clean everything up.
This PR calculates the user's distance to the reaches when their location is updated. Formerly, this update was only happening if the user's location got updated on the map view.
The code is a bit hacky. The constraints are:
Both of these constraints make it difficult to do this calculation quickly. Ideally, we would perform this calculation at the time it's needed (on the run list or map view controller). If we end up ripping out core data, we can change the data types, and clean everything up.
Hopefully this fixes https://github.com/AmericanWhitewater/aw-ios/issues/239,