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?
source
share