Label / Title Posted on marker - Google Maps Api

2

I'm working with Google Maps Api , and I need to leave the name appearing statically on top / bottom of Marker , I wanted to put this label / title when creating the marker, like title , someone knows a way simple to do this?

I'd like something like this:

My marker is being started this way:

 var marker = new google.maps.Marker({
   position: { lat: lat, lng: lng },
   map: map,
   title: localizacao.message.nome,
   icon: '../Content/imagens/Icones/Markers/green-marker.png'
 });

Thank you in advance.

    
asked by anonymous 27.07.2017 / 16:30

1 answer

1

You can put label like this:

var marker = new google.maps.Marker({
  position: myPosition,
  label: 'Nome do Marker',
  map: map
});

It will be in the middle of the icon that I chose, I already use this API of Maps for some time and I still have not figured out how to change that form that appears, but when I need to leave exactly as I want I create the image in a program and I put it in icon , just as you put green-marker.png .

    
28.07.2017 / 13:36