You are here

public function GoogleMapsService::getGmapApiLocalization in Geofield Map 8.2

Get the localized Gmap API Library.

Parameters

string $index: The index parameter.

Return value

string The Gmap Api library base Url

File

src/Services/GoogleMapsService.php, line 102

Class

GoogleMapsService
Class GoogleMapsService.

Namespace

Drupal\geofield_map\Services

Code

public function getGmapApiLocalization($index = 'default') {

  // In case of China, the google maps api should be called as not secure,
  // and this is possible only for not ssl web requests.
  $web_protocol = 'https://';
  if ($index == 'china' && !$this->requestStack
    ->getCurrentRequest()
    ->isSecure()) {
    $web_protocol = 'http://';
  }
  return isset($this->gmapApiLocalization[$index]) ? $web_protocol . $this->gmapApiLocalization[$index] : $web_protocol . $this->gmapApiLocalization['default'];
}