Error loading Google map - SensorNotRequired

I am trying to run Google Map on a WordPress site. The code works fine on this JSFIDDLE , but when I take it in WordPress I get this error

Google Maps API Warning: SensorNotRequired: https://developers.google.com/maps/documentation/javascript/error-messages

I also tried this code

<script language="javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&v=3"></script>

but the result is the same.

Finally, I tried to get the API key and use it

<script src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxxxxxxxxxxxxxxxxx&callback=initMap"
    async defer></script>

and now i get this error

Uncaught TypeError: window.initMap is not a function

Could you tell me why this is happening and how can I fix it?

+4
source share
1

:

<script language="javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&v=3"></script>

Try:

<script language="javascript" src="https://maps.googleapis.com/maps/api/js?v=3"></script>

API Google:

Google JavaScript API. API JavaScript Google Maps. , script.

+13

Source: https://habr.com/ru/post/1620435/


All Articles