You are here

public function OpenlayersService::preProcessMapSettings in Openlayers 8.4

Pre Process the MapSettings.

Performs some preprocess on the maps settings before sending to js.

Parameters

array $map_settings: The map settings.

File

src/OpenlayersService.php, line 302

Class

OpenlayersService
Provides an OpenlayersService class.

Namespace

Drupal\openlayers

Code

public function preProcessMapSettings(array &$map_settings) {

  // Generate correct Absolute iconUrl & shadowUrl, if not external.
  if (!empty($map_settings['icon']['iconUrl'])) {
    $map_settings['icon']['iconUrl'] = $this
      ->pathToAbsolute($map_settings['icon']['iconUrl']);
  }
  if (!empty($map_settings['icon']['shadowUrl'])) {
    $map_settings['icon']['shadowUrl'] = $this
      ->pathToAbsolute($map_settings['icon']['shadowUrl']);
  }
}