Created
March 25, 2017 09:22
-
-
Save rintoug/1a750f93dbce11ebce348a4bc25d54a7 to your computer and use it in GitHub Desktop.
Google Maps API Examples – Google Maps JavaScript API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&sensor=true"></script> | |
//Function | |
//Function to initialize the google map api | |
function initialize() { | |
var reqlat = '25.199971'; //Lattitude | |
var reqlong = '55.275371'; //Longittude | |
var mapOptions = { | |
center: new google.maps.LatLng(reqlat,reqlong), | |
zoom: 15, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions); | |
//Add marker | |
var marker1 = new google.maps.Marker({ | |
position: new google.maps.LatLng(reqlat,reqlong), | |
map: map | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment