bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.25k stars 198 forks source link

Call Directions Api only if new location is not in already made polyline. #206

Open PROda221 opened 2 years ago

PROda221 commented 2 years ago

Hello developers! Thank you for this great library! Great work <3 I needed to know if this is possible or in the scope of this library or not:- 1) If the new location is in the array of fetched directions, then update only the polyline between origin and destination avoiding a new directions api call. This means, the line will reduce without fetching new data from directions api. 2) If the new direction received is not in the array itself (that means driver changed route maybe), then call the api to get new directions and draw polyline accordingly.

I wanted to know if this is already handled by this library. If not, can it be considered for addition in the next update? If it is out of scope, can anyone help how to use this library to achieve the same (if possible?)

Also if this approach is not good to reduce api calls then can anyone suggest any alternatives?

Thanks!

PROda221 commented 2 years ago

Hello? Anyone here to help?

murilo8812 commented 1 year ago

same issue here! api usage is very high!