You are here

protected static function LeafletDefaultWidget::getLeafletMaps in Leaflet 2.1.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php \Drupal\leaflet\Plugin\Field\FieldWidget\LeafletDefaultWidget::getLeafletMaps()
  2. 2.0.x src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php \Drupal\leaflet\Plugin\Field\FieldWidget\LeafletDefaultWidget::getLeafletMaps()

Get maps available for use with Leaflet.

2 calls to LeafletDefaultWidget::getLeafletMaps()
LeafletDefaultWidget::defaultSettings in src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php
LeafletDefaultWidget::settingsForm in src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php

File

src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php, line 66

Class

LeafletDefaultWidget
Plugin implementation of the "leaflet_widget" widget.

Namespace

Drupal\leaflet\Plugin\Field\FieldWidget

Code

protected static function getLeafletMaps() {
  $options = [];
  foreach (leaflet_map_get_info() as $key => $map) {
    $options[$key] = $map['label'];
  }
  return $options;
}