You are here

function route_planner_library_info_build in Route Planner 8

Implements hook_library_info_build().

File

./route_planner.module, line 11
The Route Planner module create blocks to show a route from any address to a fixed point.

Code

function route_planner_library_info_build() {
  $config = \Drupal::config('route_planner.settings');
  $api_key = $config
    ->get('route_planner_api_key');
  $language = $config
    ->get('route_planner_api_language');
  $libraries = [];
  $libraries['googleapis'] = [
    'version' => '1.x',
    'js' => [
      'https://maps.googleapis.com/maps/api/js?key=' . $api_key . '&language=' . $language => [
        'type' => 'external',
        'minified' => true,
      ],
    ],
  ];
  return $libraries;
}