I want to link to a website that I'm developing a Shops API.
I'm using the following Google API - link
If I copy the whole code into an HTML, it works fine, if I put it inside my site, the map does not load and shows no error.
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 80%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 80%;
margin: 0;
padding: 0;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCPFf086alCsl076VnHe4ap3nEgCx4hZvU"></script><script>//Inthefollowingexample,markersappearwhentheuserclicksonthemap.//Eachmarkerislabeledwithasinglealphabeticalcharacter.varlabels='ABCDEFGHIJKLMNOPQRSTUVWXYZ';varlabelIndex=0;functioninitialize(){varbangalore={lat:12.97,lng:77.59};varmap=newgoogle.maps.Map(document.getElementById('map'),{zoom:12,center:bangalore});//ThiseventlistenercallsaddMarker()whenthemapisclicked.google.maps.event.addListener(map,'click',function(event){addMarker(event.latLng,map);});//Addamarkeratthecenterofthemap.addMarker(bangalore,map);}//Addsamarkertothemap.functionaddMarker(location,map){//Addthemarkerattheclickedlocation,andaddthenext-availablelabel//fromthearrayofalphabeticalcharacters.varmarker=newgoogle.maps.Marker({position:location,label:labels[labelIndex++%labels.length],map:map});}google.maps.event.addDomListener(window,'load',initialize);</script>
ThenIputthediv
I'mtryingtorunwithin link