Basic,Google,Map,Javascript

Erhan 8/26/2016 0

A Basic Google Map Script

JavaScript
 function init() {
  var mapOptions = {                                 // Set up the map options
    center: new google.maps.LatLng(40.782710,-73.965310),
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    zoom: 13
  };
  var venueMap;                                      // Map() draws a map
  venueMap = new google.maps.Map(document.getElementById('map'), mapOptions);
}

function loadScript() {
  var script = document.createElement('script');     // Create <script> element
  script.src = 'http://maps.googleapis.com/maps/api/js?sensor=false&callback=init';
  document.body.appendChild(script);                 // Add element to page
}

window.onload = loadScript;                          // on load call loadScript() 

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments