Doing anything custom with a Leaflet map requires interacting with the map object after it's loaded. A jQuery trigger would be useful for knowing when a map is loaded.

Comments

aaronbauman’s picture

There are already two triggers handling this, in leaflet.drupal.js:

          // Allow others to do something with the feature that was just added to the map
          $(document).trigger('leaflet.feature', [lFeature, feature]);

and

        // allow other modules to get access to the map object using jQuery's trigger method
        $(document).trigger('leaflet.map', [this.map, lMap]);

Are you running into this issue from Leaflet MarkerCluster?
#2005334: Interaction with Map and Map Features form outside of the Leaflet Markerclustered map

aaronbauman’s picture

sreynen’s picture

Status: Active » Fixed

I don't remember the specific context for this request. It looks like the leaflet.map trigger is probably what I needed, and that was added after I made this request, so let's call this fixed.

Status: Fixed » Closed (fixed)

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