Problem/Motivation
The leaflet version of the issue and branch in geofield_map #3087072: Geofield Map Widget visibility issue inside field group, with Leaflet library.
Which should fix issues such as:
- #2845418: Display problem with Leaflet map in Bootstrap accordion
- #3103941: Leaflet map shifts when displayed in separate tab
- #3155885: Map canvas not visible when leaflet is inside a field group
- #1916924: Maps Not Displaying Properly in Tabbed Panels (hidden divs)
Steps to reproduce
Add geofield to entity. Configure to use for widget: leaflet (default). Install field group and ptu the widget into a tab, accordion etc. where the map is initially not visible. Create/Edit an entity and click through to see the map.
Proposed resolution
Use the IntersectionObserver discussed in #3087072: Geofield Map Widget visibility issue inside field group, with Leaflet library to trigger a leaflet invalidateSize.
Remaining tasks
- Supply MR
- It's not supported by IE (but otherwise it's now well supported). Agree this is OK.
User interface changes
It works in field groups :)
API changes
None
Data model changes
None
Issue fork leaflet-3343154
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ekes commentedSo as mentioned on #3087072: Geofield Map Widget visibility issue inside field group, with Leaflet library as we know it's Leaflet we can use
invalidateSize()here and just update the map https://git.drupalcode.org/project/leaflet/-/merge_requests/27/diffsComment #4
ekes commentedComment #7
itamair commentedComment #8
itamair commentedThanks a lot @ekes ... I positively tested and reviewed your fix and deployed a new Leaflet 10.0.9 release with it.