Created
February 15, 2018 23:39
-
-
Save park-brian/ca4ae9f6a7f17c5dd3aa73ff301dfe13 to your computer and use it in GitHub Desktop.
Google Map Markers!
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple Map</title> | |
<meta name="viewport" content="initial-scale=1.0"> | |
<meta charset="utf-8"> | |
<style> | |
#map { | |
height: 100%; | |
} | |
html, body { | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script src="https://maps.googleapis.com/maps/api/js"></script> | |
<script> | |
var map = new google.maps.Map(document.getElementById('map'), { | |
center: {lat: 0, lng: 0}, | |
zoom: 6 | |
}); | |
function createMarker(color, position, map) { | |
return new google.maps.Marker({ | |
position: position, | |
map: map, | |
icon: { | |
path: "M 0 0, C -8 -10 8 -10 0 0, M 1 -5, A 1 1 0 1 0 1 -4.999", | |
fillOpacity: 1, | |
fillColor: color, | |
strokeOpacity: 0.15, | |
strokeWeight: 1, | |
scale: 5, | |
} | |
}); | |
} | |
var marker = createMarker('orange', map.getCenter(), map); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment