/ Published in: JavaScript
Basic Google Maps initialize code
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var map; function initialize() { var myLatlng = new google.maps.LatLng(51.05866,3.713379); var myOptions = { zoom: 8, center: myLatlng, streetViewControl: false, mapTypeId: "terrain", scrollwheel:false } map = new google.maps.Map(document.getElementById("'.$id.'"), myOptions); mapReady(); } function mapReady() { //Go wild } function loadScript() { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize"; document.body.appendChild(script); } window.onload = loadScript;