I am experiencing difficulty solving a problem that I have used Google Maps JS API3.
:
typeError: google.maps is undefined
This is always the case, and I can not understand it. This is driving me crazy
I have my JS files:
& lt ;! - Javascript file - & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / jquery-2.1.3.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "https://maps.googleapis.com/maps/api/js?key=****" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / lightSlider / js / jquery.lightSlider.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / light-gallery / js / light gallery.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / cycle.js" defer & gt; & Lt; / Script & gt;
And my code for getting maps is:
$. Each (google.results, function (x, y) {var lat = y geometry.location.lat; var lng = y.geometry.location.lng; var map; function initialize (lat, lng) {var mapOptions = {zoom : 8, center: new google.maps.LatLng (lat, lng)}; map = new google.maps.Map (document.getElementById ('gmaps'), map options);} google.maps.event.addDomListener (windows , 'Load', start (lat, lng)););
Let me tell you that the last block of code ($ .each) is in an AJAX call when AJAX is done.
Edit: I've tried something
Do you load the API Are you using your right key? Src = "https://maps.googleapis.com/maps/api/js?key=****"
No comments:
Post a Comment