You are here

geolocation_google_maps.module in Geolocation Field 8.2

Same filename and directory in other branches
  1. 8.3 modules/geolocation_google_maps/geolocation_google_maps.module

Google Maps hooks.

File

modules/geolocation_google_maps/geolocation_google_maps.module
View source
<?php

/**
 * @file
 * Google Maps hooks.
 */

/**
 * Implements hook_library_info_build().
 */
function geolocation_google_maps_library_info_build() {
  $libraries = [];
  $libraries['google'] = [
    'version' => '1.x',
    'js' => [
      Drupal::service('plugin.manager.geolocation.mapprovider')
        ->getMapProvider('google_maps')
        ->getGoogleMapsApiUrl() => [
        'type' => 'external',
      ],
    ],
    'dependencies' => [
      'geolocation_google_maps/googlemapsapi',
    ],
  ];
  return $libraries;
}