You are here

public function Geocoding::decodeParams in Yandex.Maps 8

Prepares values for js.

Parameters

array $params: Params of map.

Return value

array Prepared values.

File

src/Geocoding.php, line 79

Class

Geocoding
Class Geocoding.

Namespace

Drupal\yamaps

Code

public function decodeParams(array $params) : array {
  return [
    'coords' => isset($params['coords']) ? Json::decode($params['coords']) : [],
    'type' => !empty($params['coordstype']) ? $params['coordstype'] : 'yandex#map',
    'placemarks' => Json::decode($params['placemarks']),
    'lines' => Json::decode($params['lines']),
    'polygons' => Json::decode($params['polygons']),
    'routes' => Json::decode($params['routes']),
  ];
}