fix: carte - popup zindex
parent
53db9f6e41
commit
723420a168
|
@ -29,7 +29,7 @@ export default ({ resistants }: Props) => {
|
||||||
mapStyle={`https://api.maptiler.com/maps/streets-v2/style.json?key=${accessToken}`}
|
mapStyle={`https://api.maptiler.com/maps/streets-v2/style.json?key=${accessToken}`}
|
||||||
>
|
>
|
||||||
<NavigationControl />
|
<NavigationControl />
|
||||||
{resistants.map((r) => (
|
{resistants.map((r, idx) => (
|
||||||
<Marker
|
<Marker
|
||||||
key={`marker-${r.id}`}
|
key={`marker-${r.id}`}
|
||||||
longitude={r.longitude}
|
longitude={r.longitude}
|
||||||
|
@ -40,7 +40,8 @@ export default ({ resistants }: Props) => {
|
||||||
selectResistant(r);
|
selectResistant(r);
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
zIndex: isAncienResistant(r) ? 0:50
|
// Affiche les marqueurs des résistants en haut de liste avec le zIndex le plus élevé.
|
||||||
|
zIndex: resistants.length - idx
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Picto resistant={r} />
|
<Picto resistant={r} />
|
||||||
|
@ -52,7 +53,7 @@ export default ({ resistants }: Props) => {
|
||||||
longitude={selectedResistant.longitude}
|
longitude={selectedResistant.longitude}
|
||||||
latitude={selectedResistant.latitude}
|
latitude={selectedResistant.latitude}
|
||||||
anchor="bottom"
|
anchor="bottom"
|
||||||
style={{ minWidth: "40em", padding: "1em" }}
|
style={{ minWidth: "40em", padding: "1em", zIndex: resistants.length + 10 }}
|
||||||
onClose={() => selectResistant(null)}
|
onClose={() => selectResistant(null)}
|
||||||
>
|
>
|
||||||
<PopupContent resistant={selectedResistant} />
|
<PopupContent resistant={selectedResistant} />
|
||||||
|
|
Loading…
Reference in New Issue