Google-map-react: How to deal with overlapping markers?

Created on 7 Feb 2018  路  4Comments  路  Source: google-map-react/google-map-react

I have multiple markers that can potentially all appear in the same spot.

I would like to manipulate their z-index to be able to decide which one to show on top, but I haven't found a way to add styles to the inline CSS generated for the marker element's parent div? Is there any documentation about this?

Most helpful comment

Oh you're right actually. I thought I had tested that already but I might've been missing the position: absolute or relative to make the z-index work. Sorry about that!

All 4 comments

@SachaG Just adding z-index to your Marker component would do the trick. No need to add it to the marker element's parent div. Have you tried that?

Oh you're right actually. I thought I had tested that already but I might've been missing the position: absolute or relative to make the z-index work. Sorry about that!

No worries @SachaG, we're here to help!

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

colinwitkamp picture colinwitkamp  路  4Comments

Pau1fitz picture Pau1fitz  路  4Comments

nguyenthithao picture nguyenthithao  路  4Comments

edcolcode picture edcolcode  路  3Comments

figalex picture figalex  路  4Comments