Uncaught Error: Map container is already initialized.

Created on 7 June 2019, over 5 years ago
Updated 30 August 2023, over 1 year ago

When loading a Leaflet map with Leaflet Marker Clusters in a view that uses Ajax, the error;

Uncaught Error: Map container is already initialized.

Will happen on the second search. First search will work, second will not.

Solution was entirely stolen from this comment; https://www.drupal.org/project/leaflet/issues/2808957#comment-12490809

Because Marker Cluster overrides the `Drupal.behaviors.leaflet`, we also have to apply that fix here. On applying that fix, I can successfully run searches one after another.

Patch in next comment

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇦🇺Australia simon.fryer

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