distance calculating values

By: ismael khoshnaw | Asked: 09/03/2023
ForumsCategory: General questionsdistance calculating values
ismael khoshnaw asked 8 months ago
hi all, i am using Geocoder to calculate the distance between 2 addresses, I need to use the Geocoder result data (Distance Value: 48.6) as Total price, How can i do that? please   here is the result I get with Geocoder: Geocoder
  1. Place Name : N/A
  2. Street Number: 31
  3. Street Name: Ammunitiehaven
  4. Street: 31 Ammunitiehaven
  5. Street Bw: Ammunitiehaven 31
  6. Subpremise : N/A
  7. Premise : N/A
  8. Neighborhood : N/A
  9. City: Den Haag
  10. County: Den Haag
  11. Region Code: ZH
  12. Region Name: Zuid-Holland
  13. Postcode: 2511 XH
  14. Country Code: NL
  15. Country Name: Netherlands
  16. Address: Ammunitiehaven 31, 2511 XH Den Haag, Netherlands
  17. Formatted Address: Ammunitiehaven 31, 2511 XH Den Haag, Netherlands
  18. Latitude: 52.07642468210811
  19. Longitude: 4.318794717474379
  20. Distance Text: 48.6 km
  21. Distance Value: 48.6
  22. Duration Text: 37 mins
  23. Duration Value: 2214
  24. Distance destination: Geocoder ID 18
  Thanks in advance
Rob LeVineRob LeVine replied 8 months ago

I don't understand your question. You mention distance and then you mention price. Do you need the code to calculate the different between to locations?

1 Answers
Victor Font answered 8 months ago

Formidable has the Geolocation add-on, but from your question, it sounds like you opted to use the Geocoder directly from the Google Maps API. Is that correct? The data is probably being returned as a JSON object that you need to parse to extract the individual data point. Since this is not a Formidable specific question, I suggest you reach out to talk to a developer: https://formidable-masterminds.com/developers-directory/

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right