Closed DivyanshuAlok closed 4 years ago
This is an issue with your implementation, not react-native-maps-directions
itself. Therefore I'll be labelling the issue as invalid.
To answer your question though: you're passing this.getCurrentLocation()
as your origin
and your map is tracking that location (using followUserLocation={true}
). As the value for the current location will change a lot, it will result in new requests being made.
Thanks, @bramus . That's one hell of a mistake I didn't recognize.
Whenever I am reloading the application, the expected number of requests made to google direction API should be 1, but when I tally with Google API console, the number of requests is more, and it is time-bound. I.e, its ONE request every 2-3 seconds.
In the last one hour, I have reloaded the application twice and the number on request made to Directions API was 60.
And I have been building my project for the last one month. the picture below shows the API usage of last 30 days.
App.js