-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I'm trying to set the center of the map and a marker from some plain text fields in the entry but it doesn't seem to recognise the fields in the settings. When I replace the entry.locationLatitude and entry.locationLongitude with actual values it works fine, but these need to be dynamic per entry. Is this possible and if so please could you let me know how this can be done as I cannot find it anywhere in the documentation.
{% set options = {
id: 'map',
width: '100%',
height: '250px',
} %}
{{ craft.googleMaps.map(options) }}
{% set marker = {
id: 'map',
data: {
latitude: entry.locationLatitude,
longitude: entry.locationLatitude
}
} %}
{{ craft.googleMaps.center('map', entry.locationLatitude, entry.locationLongitude) }}
{{ craft.googleMaps.marker('map', marker) }}
Metadata
Metadata
Assignees
Labels
No labels