← Retour aux issues

Unexpected automatic zoom out after a few seconds

publié le
Avatar Codeberg de nuxpernuxper

Décrivez votre problème, votre suggestion

On windows / Firefox :

It may be related to the fact I clicked "Centrer sur ma position".

I zoom in manually, wait a few seconds. The map suddenly zooms out without any intervention from my part.

Expected : keep my view as is. I can click again on "Centrer sur ma position" If I want to find my position again.

I have a feeling it's due to the fact that i never clicked on the map following "Centrer sur ma position". I just used the roller on my mouse. The "Centrer sur ma position" mode therefore doesn't disengage for a reason and wants to get me back to the original zoom and position.

Système d'exploitation

Windows 11

Navigateur

Firefox. Only extension is uBlock Origin.

<video src="https://codeberg.org/attachments/49403603-ed99-48a8-bdf8-ce4f2080b0b8" title="Enregistrement de l&#39;écran 2026-09-08 121843" controls></video>

  1. Avatar Codeberg de laemlaem

    Hi ! Thanks for the issue. In fact, this is native MapLibre behaviour, through GeolocateControl.

    https://maplibre.org/maplibre-gl-js/docs/API/classes/GeolocateControl

    What happened is that you clicked the userTracking mode, and you did zoom but you did not move the map. This happens often on desktop but never on mobile : mobile two finger zoom always moves the map.

  2. Avatar Codeberg de laemlaem

    MapLibre advices to not active trackUserLocation on desktop.

    If trackUserLocation is false (default) the control acts as a button, which when pressed will set the map's camera to target the user location. If the user moves, the map won't update. This is most suited for the desktop.

    But the use of the geolocation button is also rare on desktop, so this behaviour happening when someone uses it on desktop is also rare.

    We could simply set the option to false on desktop, yes. Keeping open for a while because it's not a critical bug and because I'm working on the Galileo mode in paralel, and it will make lots of changes, introducing our own GeolocateControl for this mode :)

    Temporary solution : slightly move the map, it won't zoom again :)

  3. Avatar Codeberg de nuxpernuxper

    Thanks for the answer :) I'm ok with the temp solution ;)


✏️ Participer à la discussion