GoogleMapsConnection
in package
implements
ConnectionTypeInterface
Google Maps Platform keys — maps on the site (browser) and address geocoding (server).
The page key is visible in the page source, so it should be restricted to the site's domains in Google Cloud. A key restricted by HTTP referrer is refused by the Geocoding web service ("API keys with referer restrictions cannot be used with this API"), hence the optional second key for the server. Without it the server falls back to the page key.
Table of Contents
Interfaces
- ConnectionTypeInterface
- A kind of external connection the system knows how to use (reCAPTCHA, maps…).
Constants
- CODE : string = 'google_maps'
- FIELD_API_KEY : string = 'apiKey'
- FIELD_MAP_ID : string = 'mapId'
- FIELD_SERVER_API_KEY : string = 'serverApiKey'
Methods
- check() : ConnectionCheck|null
- Verifies the given values against the third party. Null = this type cannot be verified remotely.
- getCode() : string
- Stable identifier stored in `cms_system_external_connections.type`.
- getFields() : array<int, ConnectionField>
- getGroup() : string|null
- Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.
- supportsCheck() : bool
- Can the credentials be verified remotely? Decides whether the administration offers the check.
Constants
CODE
public
string
CODE
= 'google_maps'
FIELD_API_KEY
public
string
FIELD_API_KEY
= 'apiKey'
FIELD_MAP_ID
public
string
FIELD_MAP_ID
= 'mapId'
FIELD_SERVER_API_KEY
public
string
FIELD_SERVER_API_KEY
= 'serverApiKey'
Methods
check()
Verifies the given values against the third party. Null = this type cannot be verified remotely.
public
check(array<string|int, mixed> $values) : ConnectionCheck|null
Parameters
- $values : array<string|int, mixed>
Return values
ConnectionCheck|nullgetCode()
Stable identifier stored in `cms_system_external_connections.type`.
public
getCode() : string
Return values
stringgetFields()
public
getFields() : array<int, ConnectionField>
Return values
array<int, ConnectionField>getGroup()
Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.
public
getGroup() : string|null
Return values
string|nullsupportsCheck()
Can the credentials be verified remotely? Decides whether the administration offers the check.
public
supportsCheck() : bool