You are here

public function LeafletService::preProcessMapSettings in Leaflet 8

Pre Process the MapSettings.

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

Parameters

array $map_settings: The map settings.

File

src/LeafletService.php, line 315

Class

LeafletService
Provides a LeafletService class.

Namespace

Drupal\leaflet

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']);
  }
}