Problem/Motivation

When the Reset Map View Control is enabled on a map, the map does not load for authenticated users, with downstream libraries reporting errors such as:

Uncaught TypeError: L.FeatureGroup is undefined
    <anonymous> MarkerClusterGroup.js:5
    <anonymous> leaflet.markercluster.js:1
    <anonymous> leaflet.markercluster.js:1
leaflet.markercluster.js:1:243
Uncaught TypeError: L.Polyline is undefined
    <anonymous> https://[removed].ddev.site/modules/contrib/leaflet/js/leaflet.drupal.js?sy0tj0:1087
    <anonymous> https://[removed].ddev.site/modules/contrib/leaflet/js/leaflet.drupal.js?sy0tj0:1119
leaflet.drupal.js:1087:3
Uncaught TypeError: L.TileLayer is undefined
    <anonymous> https://[removed].ddev.site/modules/contrib/leaflet_more_maps/leaflet_more_maps.js?sy0tj0:25
leaflet_more_maps.js:25:1
Uncaught TypeError: L.DomUtil is undefined
    loadMap https://[removed].ddev.site/modules/contrib/leaflet/js/leaflet.drupal.js?sy0tj0:24
    mapObserver https://[removed].ddev.site/modules/contrib/leaflet/js/leaflet.drupal.js?sy0tj0:184
    attach https://[removed].ddev.site/modules/contrib/leaflet/js/leaflet.drupal.js?sy0tj0:180
    jQuery 2
    attach https://[removed].ddev.site/modules/contrib/leaflet/js/leaflet.drupal.js?sy0tj0:16
    each jQuery
    attach https://[removed].ddev.site/modules/contrib/leaflet/js/leaflet.drupal.js?sy0tj0:10
    attachBehaviors https://[removed].ddev.site/core/misc/drupal.js?v=10.4.7:166
    attachBehaviors https://[removed].ddev.site/core/misc/drupal.js?v=10.4.7:162
    insert https://[removed].ddev.site/core/misc/ajax.js?v=10.4.7:1402
    jQuery 2
    insert https://[removed].ddev.site/core/misc/ajax.js?v=10.4.7:1394
    commandExecutionQueue https://[removed].ddev.site/core/misc/ajax.js?v=10.4.7:1046
    promise callback*Drupal.Ajax.prototype.commandExecutionQueue/< https://[removed].ddev.site/core/misc/ajax.js?v=10.4.7:1039
    commandExecutionQueue https://[removed].ddev.site/core/misc/ajax.js?v=10.4.7:1036
    success https://[removed].ddev.site/core/misc/ajax.js?v=10.4.7:1095
    success https://[removed].ddev.site/modules/contrib/blazy/js/base/io/bio.ajax.min.js?sy0tj0:1
    processReplacement https://[removed].ddev.site/core/modules/big_pipe/js/big_pipe.js?v=10.4.7:84
    checkMutationAndProcess https://[removed].ddev.site/core/modules/big_pipe/js/big_pipe.js?v=10.4.7:110
    processMutations https://[removed].ddev.site/core/modules/big_pipe/js/big_pipe.js?v=10.4.7:134
    processMutations https://[removed].ddev.site/core/modules/big_pipe/js/big_pipe.js?v=10.4.7:133
    MutationCallback* https://[removed].ddev.site/core/modules/big_pipe/js/big_pipe.js?v=10.4.7:150
    <anonymous> https://[removed].ddev.site/core/modules/big_pipe/js/big_pipe.js?v=10.4.7:184
leaflet.drupal.js:24:64

Steps to reproduce

Proposed resolution

Removing the library leaflet/leaflet.reset_map_view from rendering in the HEAD, and allowing to render when needed.

Remaining tasks

User interface changes

API changes

None.

Data model changes

None.

Issue fork leaflet-3530635

Command icon 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

jaypan created an issue. See original summary.

jaypan’s picture

Status: Active » Needs review

  • itamair committed c6f96279 on 10.3.x
    Remove explicit load of Leaflet libraries from the header, as they could...
itamair’s picture

Status: Needs review » Fixed

Ok ... I extended the leaflet.reset_map_view fix (removal it explicit load from the header) to all the other leaflet modules libraries requested in the same way, and I couldn't find any regressions, in the drupal instances and use cases that I tested,
and even some performance improvements.

This commit https://git.drupalcode.org/project/leaflet/-/commit/c6f962793fd7f6c1fcd3... includes this MR!58 fix.
Closing the MR!58 and going to deploy new releases for both the 10.3.x and 10.2.x brach with all this.

  • itamair committed 4c0dd736 on 10.2.x
    Remove explicit load of Leaflet libraries from the header, as they could...
itamair’s picture

leaflet 10.3.1 release should have fixed this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.