You are here

protected static function LeafletWidget::getLeafletMaps in Leaflet Widget for Geofield 8

Get maps available for use with Leaflet.

2 calls to LeafletWidget::getLeafletMaps()
LeafletWidget::defaultSettings in src/Plugin/Field/FieldWidget/LeafletWidget.php
Defines the default settings for this plugin.
LeafletWidget::settingsForm in src/Plugin/Field/FieldWidget/LeafletWidget.php
Returns a form to configure settings for the widget.

File

src/Plugin/Field/FieldWidget/LeafletWidget.php, line 111

Class

LeafletWidget
Plugin implementation of the "leaflet_widget" widget.

Namespace

Drupal\leaflet_widget\Plugin\Field\FieldWidget

Code

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