Uncaught Error: Map container is already initialized.

Created on 7 June 2019, about 5 years ago
Updated 30 August 2023, 10 months 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.69.0 2024