[Bug] onMoveEnd event is fired on second map on remount with reuseMaps
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia eseguendo la riproduzione CodeSandbox collegata e alternando Unmount/Mount diverse volte con reuseMaps abilitato per entrambe le mappe. Traccia la gestione del remount di reuseMaps e l’evento moveend della mappa principale, quindi verifica che il remount non modifichi lo zoom della mini mappa e non riporti lo stato della vista della mappa sbagliata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
I have a main map and a mini map.
I would like the view state of the main map to drive the mini map, however the mini map should always be 2 zoom levels lower than the main map.
The main map is uncontrolled, the mini map is controlled.
The main map view state is stored in React state which updates when the main map moveend event fires.
The maps appear in a modal, so are unmounted and remounted as the modal is opened and closed. So I also have reuseMaps added to reduce mapbox map loads from the frequent mounting.
Each time the maps are remounted, the mini map zoom level decreases by 2 without moving the main map.
This only occurs when reuseMaps is set for both maps. But of course, I'd like to reuse both to save on map loads :)
The bug appears to be, at least, that the moveend callback for the main map is fired with the zoom level of the mini map, NOT the main map
You can see in the logs of the moveend callback that the zoom of the event view state doesn't match the main map zoom even when not changing the main map zoom. and the ID of the container for the event is indeed the main map.
But additionally may be that the moveend callback fires when the maps remount, when in reuse mode? does remount when reuse is on count as a move event?
Expected Behavior
moveend doesn't fire with reuse + remount? Or at least, the zoom of the event should match to the map the handler is attached to.
The zoom level of the mini map shouldn't change.
Steps to Reproduce
https://codesandbox.io/p/sandbox/epic-liskov-mymg27
Click Unmount/Mount several times to observe the mini map zoom level decreases each time
Environment
- Framework version: [email protected] and [email protected]
- Map library: [email protected] (in reproduction) and [email protected] (in local app)
- Browser: Chrome Version 134.0.6998.119
- OS: Windows 10
Logs
No response
- Lingua principale
- TypeScript
- Stelle
- 8.5k
- Fork
- 1.3k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di visgl/react-map-gl
-
DEFAULT_SETTINGS.maxBounds in @vis.gl/react-maplibre has 360° longitude span, triggers maplibre-gl-js#6148 crash via _updateSettings fallbackForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
visgl/react-map-gl#2591 · 2 commenti ·
-
[Bug] Mapbox geocoder example crashes: "i is not a function"Forse già presa @yuiseki l’ha presa 20 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
visgl/react-map-gl#2628 ·
-
[Bug] Scroll zoom stops short of maxZoom in controlled mode with MapLibreForse già presa @sviat-barbutsa l’ha presa 33 giorni fa. Apertabug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 74/100
visgl/react-map-gl#2626 ·
-
[Bug] reuseMaps: Mapbox.reuse() infinite-loops (tab freeze) when the recycled map's container is the mount containerForse già presa @mikeyfarina l’ha presa 82 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
visgl/react-map-gl#2613 ·
-
feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
visgl/react-map-gl#2603 · 1 reazione ·
Tutte le issue di visgl/react-map-gl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
can1357/oh-my-pi#21349 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ohcnetwork/care_fe#17474 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100