How to set label position and style? I tried new google.maps.Marker
and new MarkerWithLabel
. But both didn't work.
Here is my current map:
Here is my code:
function addMarker(place)
{
// TODO
var myLatLng = {lat: parseFloat(place.latitude), lng: parseFloat(place.longitude)};
var image = 'http://maps.google.com/mapfiles/kml/pal2/icon31.png';
// var marker = new google.maps.Marker({
// position: myLatLng,
// map: map,
// icon: image,
// label: place.place_name + ", " + place.admin_name1,
// labelAnchor: new google.maps.Point(0, 32)
// });
var marker = new MarkerWithLabel({
position: myLatLng,
map: map,
icon: image,
label: place.place_name + ", " + place.admin_name1,
labelAnchor: new google.maps.Point(50, 0),
});
markers.push(marker);
}
UPDATE: Can I set label position with new google.maps.Marker
?