You are here

public function IpGeoLocGlobal::openlayersMarkerLayers in IP Geolocation Views & Maps 8

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

Return value

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

File

src/Services/IpGeoLocGlobal.php, line 385

Class

IpGeoLocGlobal
Class IpGeoLocGlobal.

Namespace

Drupal\ip_geoloc\Services

Code

public function openlayersMarkerLayers() {
  $num_location_marker_layers = $this->config
    ->get('ip_geoloc_num_location_marker_layers') ? $this->config
    ->get('ip_geoloc_num_location_marker_layers') : IP_GEOLOC_DEF_NUM_MARKER_LAYERS;
  $marker_layers = [];
  for ($layer = 1; $layer <= $num_location_marker_layers; $layer++) {
    $marker_layers[$layer] = $this->stringTranslation
      ->translate('Marker layer') . " #{$layer}";
  }
  return $marker_layers;
}