trigger_geocode() should zoom before panning

Created on 18 August 2021, over 3 years ago
Updated 25 February 2023, almost 2 years ago

Problem/Motivation

If the initial zoom is way smaller than the focus zoom, the first time trigger_geocode() is called the panning will be slightly off.
It seems to happen because Leaflet will pan with the initial zoom (which is low so the panning does not have to be super precise) and then zoom.

Steps to reproduce

  1. Use a geofield_map widget with Leaflet.
  2. Select a town in the autocomplete field.
  3. The map zooms and pans slight out of town.

Proposed resolution

setZoomToFocus() should be called before mapSetCenter().
This way, when the panning happens, it already knows at what zoom level the marker should be into view.

Remaining tasks

I will submit a patch.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024