You are here

private function LeafletGeojson::leafletGeojsonMapPaneRenderJavascriptSettings in Leaflet GeoJSON 8

Helper function to generate the javascript settings.

1 call to LeafletGeojson::leafletGeojsonMapPaneRenderJavascriptSettings()
LeafletGeojson::build in src/Plugin/Block/LeafletGeojson.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/LeafletGeojson.php, line 278

Class

LeafletGeojson
Provides a 'Leaflet Geojson' Block.

Namespace

Drupal\leaflet_geojson\Plugin\Block

Code

private function leafletGeojsonMapPaneRenderJavascriptSettings() {
  $conf = $this->configuration;

  // Gather information about the leaflet base and data layers.
  $data_layers_info = [];
  foreach ($conf['map_settings']['info']['data'] as $layer_idx => $layer_machine_name) {
    $data_layers_info[$layer_idx] = leaflet_geojson_source_get_info($layer_machine_name);
  }
  return $data_layers_info;
}