You are here

function leaflet_widget_base_layers in Leaflet Widget for Geofield 7

Same name and namespace in other branches
  1. 7.2 leaflet_widget.module \leaflet_widget_base_layers()
2 calls to leaflet_widget_base_layers()
leaflet_widget_field_widget_info in ./leaflet_widget.module
Implements hook_field_widget_info().
leaflet_widget_field_widget_settings_form in ./leaflet_widget.module
Implements hook_field_widget_settings_form().

File

./leaflet_widget.module, line 278

Code

function leaflet_widget_base_layers() {
  $options = array();
  if (module_exists('leaflet')) {
    foreach (leaflet_map_get_info() as $id => $map) {
      foreach ($map['layers'] as $layer_id => $layer) {
        $options[$layer['urlTemplate']] = "{$id} - {$layer_id}";
      }
    }
  }
  return array_merge($options, module_invoke_all('leaflet_widget_base_layers'));
}