Sorry, don't have a reduced test case. We had things all working but then swapped some non-maps Twig to use .collect() instead of .all() - and the Google Maps infoWindows stopped working.
Looks like the plugin is not finding something when the main pins query(s) use .collect() instead of .all().
{# Create the map with no markers #}
{% set map = googleMaps.map() %}
{# Configure the icons #}
{% set iconProtected = {
'url': '/dist/images/pins/protected-park.svg',
'scaledSize': {'width': 30, 'height': 40}
} %}
{% set iconUnprotected = {
'url': '/dist/images/pins/unprotected-park.svg',
'scaledSize': {'width': 30, 'height': 40}
} %}
{# Add all the protected park markers to the map #}
{% do map.markers(protectedParksInRange, {
'icon': iconProtected,
'infoWindowTemplate': '_partials/map-info-window',
'components': {
'country': 'UK'
}
}) %}
{# Add all the unprotected park markers to the map #}
{% do map.markers(unprotectedParksInRange, {
'icon': iconUnprotected,
'infoWindowTemplate': '_partials/map-info-window',
'components': {
'country': 'UK'
}
}) %}
{# Draw the range circle #}
{% do map.circles(locationSearchMatchedAddress, {
'circleOptions': {
'radius': searchedRadius * 1000,
'fillColor': '#7A9F35',
'fillOpacity': 0.35,
'strokeColor': '#7A9F35',
'strokeOpacity': 0.8,
'strokeWeight': 2,
}
}) %}
{# Apply the styles #}
{% do map.styles(styles) %}
{# Output the map to markup #}
{{ map.tag() }}
Map and pins load fine; clicking on the pins to trigger a pop-up will only work if the original query was a .all(), nothing at all happens on click of the pin when the original query is a .collect()
Sorry, don't have a reduced test case. We had things all working but then swapped some non-maps Twig to use
.collect()
instead of.all()
- and the Google MapsinfoWindows
stopped working.Looks like the plugin is not finding something when the main pins query(s) use
.collect()
instead of.all()
.querys
Allows the later code to work:
Breaks the later code:
map code
Map and pins load fine; clicking on the pins to trigger a pop-up will only work if the original query was a
.all()
, nothing at all happens on click of the pin when the original query is a.collect()