ev-map / EVMap

Android app to find electric vehicle charging stations - compatible with community databases such as GoingElectric.de and OpenChargeMap.org.
https://ev-map.app/
MIT License
201 stars 54 forks source link

Calculate distance to charger from arbitrary point. #354

Open kscholty opened 3 months ago

kscholty commented 3 months ago

During planning of a trip I often calculate a rough point around which I will probably have to charge. It would be great if I could look for chargers in that area, getting a distance reading from that point to the selected charger. Currently I get a distance only to my current position which is not useful for planning.

johan12345 commented 3 months ago

Thanks, good idea! A simple solution would be to make use of the existing place search feature - if a place has been selected from search results, we could display the distance to that place instead of the current position. This could also be expanded so that long-pressing the map can also be used to select a place instead of requiring to use the search function.

Note that the displayed distances are currently always calculated as the crow flies, not with an actual navigation route. At some point this might have to change (also for other features like finding chargers along a route - #143), but that will cause additional costs for routing APIs...

kscholty commented 3 months ago

Yes, I like that idea. Especially the long press to set the position sounds good. And since it's mostly for shorter distances anyhow, I guess having just a straight line distance is ok.