F
Filament15mo ago
Virgil

Google Distance Matrix API

Hello, has anyone have experience with implementing the Google Distance Matrix API into a Filament form? I need to find a solution to calculate a distance between two addresses and I need to know the distance to every country border on the route. Does anyone can help me with some coding solutions?
6 Replies
mohdaftab
mohdaftab5mo ago
@Virgil Hi, did you figure it out?
Virgil
VirgilOP5mo ago
Nope, still working on a solution... I'm even looking into the TomTom API, but still no solution found.
mohdaftab
mohdaftab5mo ago
@Virgil for me I just had to show the static image map with Point A to B including the distance and duration so I used this endpoint "https://maps.googleapis.com/maps/api/directions/json?origin=&destination=&key=" to get the distance, direction and the path, which I passed on to endpoint "https://maps.googleapis.com/maps/api/staticmap" including the markers to get the image like this
No description
mohdaftab
mohdaftab5mo ago
the same thing we can do to embedded map as well using an iframe inside HtmlString
Virgil
VirgilOP5mo ago
I need to calculate the distance to a border.. For instance... I drive from Amsterdam to Paris.. Then I want to know how many kilometers to the Belgium border and then how many kilometers from the Belgium border to the France border and finaly the kilometers to the destination.
mohdaftab
mohdaftab5mo ago
I am not sure how this can be done, but I think this could be done with a radius from each point to find the nearest borders and then get the distance to that.
Want results from more Discord servers?
Add your server