Skip to content

Instantly share code, notes, and snippets.

@park-brian
Created February 15, 2018 23:39
Show Gist options
  • Save park-brian/ca4ae9f6a7f17c5dd3aa73ff301dfe13 to your computer and use it in GitHub Desktop.
Save park-brian/ca4ae9f6a7f17c5dd3aa73ff301dfe13 to your computer and use it in GitHub Desktop.
Google Map Markers!
<!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