You are here

public function MapLinkBase::getAddressUrl in Address Map (& Directions) Link 8

Gets the map link url from an address.

Parameters

\Drupal\address\AddressInterface $address: The address.

Return value

\Drupal\Core\Url The Url.

Overrides MapLinkInterface::getAddressUrl

10 methods override MapLinkBase::getAddressUrl()
AppleMaps::getAddressUrl in src/Plugin/MapLink/AppleMaps.php
Gets the map link url from an address.
BingMaps::getAddressUrl in src/Plugin/MapLink/BingMaps.php
Gets the map link url from an address.
GoogleMaps::getAddressUrl in src/Plugin/MapLink/GoogleMaps.php
Gets the map link url from an address.
GoogleMapsDirections::getAddressUrl in src/Plugin/MapLink/GoogleMapsDirections.php
Gets the map link url from an address.
HereWeGoMaps::getAddressUrl in src/Plugin/MapLink/HereWeGoMaps.php
Gets the map link url from an address.

... See full list

File

src/MapLinkBase.php, line 30

Class

MapLinkBase
Base class for Map link plugins.

Namespace

Drupal\address_map_link

Code

public function getAddressUrl(AddressInterface $address) {
  return Url::fromUri('https://google.com/maps', [
    'query' => [
      'q' => $this
        ->addressString($address),
    ],
  ]);
}