You are here

private function LeafletDefaultFormatter::setExistingZoomSettings in Leaflet 8

Same name and namespace in other branches
  1. 2.1.x src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php \Drupal\leaflet\Plugin\Field\FieldFormatter\LeafletDefaultFormatter::setExistingZoomSettings()
  2. 2.0.x src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php \Drupal\leaflet\Plugin\Field\FieldFormatter\LeafletDefaultFormatter::setExistingZoomSettings()

Sets possibly existing previous settings for the Zoom Form Element.

1 call to LeafletDefaultFormatter::setExistingZoomSettings()
LeafletDefaultFormatter::viewElements in src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php
This function is called from parent::view().

File

src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php, line 443

Class

LeafletDefaultFormatter
Plugin implementation of the 'leaflet_default' formatter.

Namespace

Drupal\leaflet\Plugin\Field\FieldFormatter

Code

private function setExistingZoomSettings() {
  $settings = $this
    ->getSettings();
  if (isset($settings['zoom'])) {
    $settings['map_position']['zoom'] = (int) $settings['zoom'];
    $settings['map_position']['minZoom'] = (int) $settings['minZoom'];
    $settings['map_position']['maxZoom'] = (int) $settings['maxZoom'];
    $this
      ->setSettings($settings);
  }
}