When a LayerGroup
is created, then it gets a numerical id. Thus the layer containing all markers (for example) is not easily accessible in client-side Javascript.
A simple solution is to add the attribute 'leaflet_id' to the group feature when creating the the data structure of the map.
$features_group = array(
'leaflet_id' => 'markers',
'group' => 'markers',
'label' => t('Markers'),
'features' => $features,
);
In leaflet.drupal.js
this attribute is recognized when creating the LayerGroup
and the LayerGroup can be accessed, like in this example:
var markerLayer = Drupal.settings.leaflet[0].lMap._layers['markers']
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.