You are here

function ip_geoloc_openlayers_marker_layers in IP Geolocation Views & Maps 8

Same name and namespace in other branches
  1. 7 ip_geoloc.module \ip_geoloc_openlayers_marker_layers()

Return available OpenLayers marker layers for use in a select drop-down.

Return value

array An array indexed by marker layer number (1..n)

2 calls to ip_geoloc_openlayers_marker_layers()
IpGeoLocViewsPluginStyle::pluginStyleDiffColorTableRowForm in src/Services/IpGeoLocViewsPluginStyle.php
Diffs the color table plugin style row.
_ip_geoloc_plugin_style_diff_color_table_row_form in src/Plugin/views/style/ip_geoloc_plugin_style.inc
Diffs the color table plugin style row.

File

./ip_geoloc.module, line 617
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function ip_geoloc_openlayers_marker_layers() {
  $config = \Drupal::config('ip_geoloc.settings');
  $num_location_marker_layers = $config
    ->get('ip_geoloc_num_location_marker_layers');
  $num_location_marker_layers = $num_location_marker_layers ? $num_location_marker_layers : IP_GEOLOC_DEF_NUM_MARKER_LAYERS;
  $marker_layers = [];
  for ($layer = 1; $layer <= $num_location_marker_layers; $layer++) {
    $marker_layers[$layer] = t('Marker layer') . " #{$layer}";
  }
  return $marker_layers;
}