-1

i have a URL like this

https://maps.googleapis.com/maps/api/directions/json?origin=30.03049985444775,31.40335779637098&destination=30.185096658446447,31.520390957593914&language=ar&key=Key

when i try to use it in axios i get error

Access to XMLHttpRequest at 'https://maps.googleapis.com/maps/api/directions/json?origin=30.03049985444775,31.40335779637098&destination=30.185096658446447,31.520390957593914&language=ar&key=Key' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Hani Gerges
  • 92
  • 1
  • 11

1 Answers1

1

This is answered here: Google Maps API: No 'Access-Control-Allow-Origin' header is present on the requested resource

You need to be using the Google Maps JS API.

sevensidedmarble
  • 643
  • 1
  • 4
  • 14