"Lazy load map" broken

Created on 4 July 2024, 4 months ago
Updated 8 July 2024, 4 months ago

Problem/Motivation

Lazy loaded maps fail to load (perhaps only if they appear straight away?).

Steps to reproduce

Create a map with "Lazy load map" checked.

Workaround

Turn off lazy loading, and the map appears correctly.

💬 Support request
Status

Closed: works as designed

Version

10.2

Component

Code

Created by

🇬🇧United Kingdom fonant

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

Comments & Activities

  • Issue created by @fonant
  • Status changed to Closed: works as designed 4 months ago
  • 🇮🇹Italy itamair

    @fonant I properly checked this report of you and I don't evidence and confirmation of the (assumed)) bug that you report.

    This Leaflet Demo View map:
    https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geoplaces-ma...
    is using Leaflet module version 10.2.19, and "Lazy load map" option checked ... and ALL WORKS AS EXPECTED
    (you can check the inspector on that web page).

    So as also other Leaflet 10.2.19 View Maps that I am testing.

    Let's change this into Support Request (because no evidence is provide of a general bug),
    and please check and review your personal use case and setup ... (it should be due to that), and please reopen this only if you can provide proper evidence of a general issue on this Lazy Load future (and how can it be clearly reproduced).

  • 🇬🇧United Kingdom fonant

    This feature was working fine, until the latest Leaflet module update. Nothing special about the site setups. The problem was noticed by two of my customers on separate websites on different servers (one running Apache, one running OpenLitespeed).

    Tested in Vivalid (Chrome) and Firefox, both showed the problem.

    Maps generated as a field display, and from Views, both affected. Working fine without lazy loading, blank with lazy loading.

    Difficult to debug a lack of JavaScript action, and I'm no JavaScript expert. Perhaps it's something specific I've done - at least the workaround is easy :)

  • 🇮🇹Italy itamair

    Well, if it is JavaScript issue (and could eventually be only that) then the browser inspector should report / show an error on the browser js console error side.
    The latest release just embedded the polifill.js (intersectionObserver subcode) into the Leaflet module itself … and that would be used only in very/pretty old browsers versions … in the expected scenario.

    It would be nice to be pointed to a website instance (of those from you)that generates the errore you report … so to debug in the is inspector, but of course the specific website instance should be set with Lazy Load … at least for the time of inspecting.

  • 🇬🇧United Kingdom fonant

    Here's a page with a lazy-loaded map that isn't currently working for me: https://bucks-composites.com/events

    There should be a simple views-created map under the Events teasers.

    The map DIV is created and sized, but no map is loaded.

    Thanks for investigating!

  • 🇬🇧United Kingdom fonant

    I may have been mistaken about other sites having lazy-loading broken since the last update: it could be just this one site.

    It's an OpenLitespeed server. I did have trouble with the Litespeed Cache, but that's disabled for the site now. Restarting OLS and PHP doesn't help.

  • 🇮🇹Italy itamair

    I cannot see any js issue on the https://bucks-composites.com/events
    hence cannot deduct any issue evidence from it ...

    BUT I can see that you write the following:

    I may have been mistaken about other sites having lazy-loading broken since the last update: it could be just this one site.

    Let's say that rather you didn't explain properly, and from the above phrase I deduct that you have other sites that are working fine with "Lazy load map" on Leaflet 10.2.19,
    isn't it?

    Hence this is indeed only something related to that specific https://bucks-composites.com/events one,
    and indeed not a general issue ...

  • 🇬🇧United Kingdom fonant

    The problem on that site is that with "Lazy load map" turned on, the map doesn't load. No JavaScript errors, but no map either.

    Yes, the problem only happens for me on that one site, but the problem appeared after a Leaflet module update, nothing else changed from when "Lazy load map" was working fine on that site.

    Anyway, the workaround is easy, and there might be an issue with OpenLitespeed caching something wrongly. Thanks for looking into this for me :)

Production build 0.71.5 2024