Markers style z-index #259
-
Beta Was this translation helpful? Give feedback.
Answered by
giorgiabosello
May 8, 2024
Replies: 1 comment 5 replies
-
Hi @petritnuredini I should update the documentation, by the way, zIndex prop is managed on the Marker itself and forwarded to the Overlay, so you can control it, like this: <GoogleMap
apiKey={googleMapApi}
defaultCenter={{ lat: 45.4046987, lng: 12.2472504 }}
defaultZoom={5}
options={defaultProps}
mapMinHeight="100%"
onGoogleApiLoaded={onGoogleApiLoaded}
onChange={(map) => onMapMove(map)}
loadingContent={null}
>
{Companies.map((company: CompanyDetails, index: number) => (
<Marker
key={index}
lat={company.lat}
lng={company.lng}
company={company}
markerId={company.id}
onClick={onMarkerClick}
isActive={company.id === activeTooltipId}
setActiveTooltipId={setActiveTooltipId}
zIndex={company.id === activeTooltipId ? 1 : 0} // here
/>
))}
</GoogleMap> For reference, z-index is managed here and used in the overlay, here. Let me know if it works :) |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
petritnuredini
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @petritnuredini I should update the documentation, by the way, zIndex prop is managed on the Marker itself and forwarded to the Overlay, so you can control it, like this: