122
rated 0 times
[
124]
[
2]
/ answers: 1 / hits: 27358
/ 11 Years ago, fri, march 29, 2013, 12:00:00
I've been trying to embed a google map in my site , but with not much success.
I've used the next code section: (i'm using an actual api key on my own computer)
<script type=text/javascript
src=https://maps.googleapis.com/maps/api/js?key=myapikey&sensor=true>
</script>
<script type=text/javascript>
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById(map-canvas),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
inside <body>
section i've added <div id=map-canvas style=width: 40%; height: 40%></div>
How could I handle this problem ?
Thanks in advance
More From » html