ContactMapService

This service class exposes a method used for getting map coordinates from the Google Maps API.
All public functions are available in the Twig template renderer.

Namespace

IO\Services

Constants
Type Name Value Description

string

COORD_CACHE_KEY

'ceresMapCoordinates'

Properties
Type Name Description

CachingRepository

$cachingRepository

Repository for caching in Redis

string

$pluginNamespace

Methods
public __construct($cachingRepository)

ContactMapService constructor.

Parameters

Type

Name

Description

CachingRepository

$cachingRepository

Repository for caching in Redis

public getMapCoordinates($apiKey, $street, $zip = null):Services

Get coordinates for a street at a specific zipcode from Google Maps API.

Parameters

Type

Name

Description

string

$apiKey

Google Maps API Key

string

$street

Name of the street, optionally with house number

string

$zip

Optional: Zip code for address (Default: null)