Google-maps-react: Request: Marker label

Created on 28 Oct 2016  路  4Comments  路  Source: fullstackreact/google-maps-react

Most helpful comment

I realize that this is nearly 2 years late to the party but you can use the label prop of the Marker, which can either be a string or a MarkerLabel object. Just assign an object with props in that API to the label prop of your Marker, like this:

<Marker
  position={center}
  label={{
    text: "Hello World!",
    fontFamily: "Arial",
    fontSize: "14px",
  }}
  icon={{
    url: imageUrl,
    anchor: new google.maps.Point(53,53),
    labelOrigin: new google.maps.Point(53,115),
  }}
/>

I hope this helps someone!

All 4 comments

馃憤

Any update on this?

I realize that this is nearly 2 years late to the party but you can use the label prop of the Marker, which can either be a string or a MarkerLabel object. Just assign an object with props in that API to the label prop of your Marker, like this:

<Marker
  position={center}
  label={{
    text: "Hello World!",
    fontFamily: "Arial",
    fontSize: "14px",
  }}
  icon={{
    url: imageUrl,
    anchor: new google.maps.Point(53,53),
    labelOrigin: new google.maps.Point(53,115),
  }}
/>

I hope this helps someone!

image
It shows label outside the marker, can i show label in the marker like https://developers.google.com/maps/documentation/javascript/examples/marker-labels

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anushreepatil picture anushreepatil  路  5Comments

antonk52 picture antonk52  路  5Comments

EmmaU25 picture EmmaU25  路  3Comments

ranleung picture ranleung  路  4Comments

rullymartanto picture rullymartanto  路  5Comments