Google Maps
DEV-NOTES:
-
Add the entries
['gdpr-facade', 'google-maps']to your page template. - The templates and the GoogleMaps API-script are included here where they are also needed. If GoogleMaps is needed on every page, add it once with other templates / scripts.
-
Add the
Google API Keyinto the env file (see .env.example file).
NOTE: For autocomplete and the my-location-button, the Places API is needed and should extend the API Url with&libraries=places. -
To change or add new styles:
'./src/scss/entry/google-maps.scss' -
To change or add new configuration to the Google Maps API:
'./src/js/google-maps/search.js' - Click here to get a list of all available parameters (Maps Javascript API).
- Click here to get a list of all available parameters (MarkerClusterer).
-
To change or add new configuration for autocomplete (City or Postal Code):
'./src/js/google-maps/suggest.js' - The my-location-button only works with https!
-
Dummy data / query values:
Numbers correspond to the total of items that will be found (e.g.: 12). -
To change the result template:
'./partials/tmpl/google-maps/results.html.twig'. BE -
The values of the following fields MUST BE set (a standard location or the location,
after an user has searched for it on another page). BE
<input type="hidden" class="lat" value="VALUE-HERE">
<input type="hidden" class="lng" value="VALUE-HERE"> -
GoogleMaps should always be embed with a facade: BE
-
Embed GoogleMaps with gdpr-facade (CookiePro / Usercentrics) integration:
-
X results found