var geocoder;
var map;
function initialize() {
var map = new google.maps.Map(
document.getElementById("map_canvas"), {
center: new google.maps.LatLng(37.4419, -122.1419),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var p;
p = new google.maps.Data();
p.addGeoJson({
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"icon": "http://maps.google.com/mapfiles/ms/micons/blue.png",
"title": "blue",
},
"geometry": {
"type": "Point",
"coordinates": [-122.1419, 37.4419]
}
}]
});
p.setStyle(function(feature) {
var icon = feature.getProperty('icon');
var title = feature.getProperty('title');
return {
icon: {
url: icon,
labelOrigin: new google.maps.Point(15, -10)
},
label: {
color: "blue",
fontFamily: "Courier",
fontSize: "24px",
fontWeight: "bold",
text: title
}
}
});
p.setMap(map);
}
google.maps.event.addDomListener(window, "load", initialize);
html,
body,
#map_canvas {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px
}
<script src="https://maps.googleapis.com/maps/api/js"></script>
<div id="map_canvas"></div>