Created
June 7, 2016 16:56
-
-
Save bogvsdev/b88c9714100f36b0e29333483c6413f6 to your computer and use it in GitHub Desktop.
Simple marker on google map without getting api key
This file contains 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
// 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