Skip to content

Is there a way to make markers with dynamic labels #2847

Answered by nonoumasy
nonoumasy asked this question in Q&A
Discussion options

You must be logged in to vote

I got this to work using...

<OverlayView
    onClick={() => alert(item.id)}
    position={{
      lat: item.latitude ? item.latitude : 0,
      lng: item.longitude ? item.longitude : 0,
    }}
    mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET}
  >
    <div style={{ display: "flex" }}>
        <div
          className="map-marker-container"
          style={{
            position: "relative",
            width: 60,
            height: 45,
          }}
        >
      <div className="popup">{i + 1}</div>
    </div>
  </OverlayView>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nonoumasy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant