Skip to content

Instantly share code, notes, and snippets.

@bogvsdev
Created June 7, 2016 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogvsdev/b88c9714100f36b0e29333483c6413f6 to your computer and use it in GitHub Desktop.
Save bogvsdev/b88c9714100f36b0e29333483c6413f6 to your computer and use it in GitHub Desktop.
Simple marker on google map without getting api key
// In html
// <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
// In js
var map = {
init: function(){
var mlatlang = new google.maps.LatLng(33.8633401, -117.8517839);
var mapOptions = {
center: mlatlang,
zoom: 15,
scrollwheel: false
};
var marker = new google.maps.Marker({
position: mlatlang,
title: 'Some title'
});
var map = new google.maps.Map(document.getElementById('map'),
mapOptions);
marker.setMap(map);
}
}
$(function(){
map.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment