I am making a map, using Google api. How to load all needed maps libraries correctly? I get 'google is not defined'
<script src=" https://maps.googleapis.com/maps/api/js?key=key&callback=initMap&libraries=maps" async defer></script>
Must I put v.3exp or something else?
Is this code good?
<script>
let map;
function initMap() {
map = new window.google.maps.Map( document.getElementById( 'map' ), {
center: {
lat: 51.513329,
lng: -0.088950
},
zoom: 14
});
}
google.maps.event.addDomListener(window, 'load', initialize); //error here
google.maps.event.addListener(map, 'click', function(event) {document.write('Hi');});
</script>
I tried all variants, no work