Im trying to place a google map on my website but its not working. Here is the code that I have. Can anyone tell me what Im doing wrong. Thanks
<head>
<title>Environment Impact</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script>src="http://maps.googleapis.com/maps/api/js?key=MY_API_KEY=TRUE"></script>
<script type="text/javascript">
function initialize() {
var california = new google.maps.LatLng(-122.23354, 37.48787);
var myOptions = {
center: california,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map-canvas"), myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="map-canvas" style="width:800px; height:600px; border:1px solid #000;"></div>
</body>
You have wrong formatting and possibly bad parameters:
should be something like:
making sure the
MY_API_KEYis replaced by your Google Map API key, or simply ignore this parameter if you don’t need it.Not sure you want the
sensortoTRUE, I just guessed since you had an orphan=TRUEparameter