Skip to content

Instantly share code, notes, and snippets.

@rintoug
Created March 25, 2017 09:22
Show Gist options
  • Save rintoug/1a750f93dbce11ebce348a4bc25d54a7 to your computer and use it in GitHub Desktop.
Save rintoug/1a750f93dbce11ebce348a4bc25d54a7 to your computer and use it in GitHub Desktop.
Google Maps API Examples – Google Maps JavaScript API
<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