I've got a google maps for EE map with multiple pins working. I've also set it to add a class to a div further down the page when clicking a pin.
However what I need is to remove that class when closing the infobox. Unfortunately I am unable to figure out how to target the close button as the inspector doesn't appear to work over the map. I've tried toggleClass but that only works when you click the pin again, not close the infobox.
My current working code is here, the jquery is at the bottom in the exp:gmap:event tag pair - I've added a second event tag pair targetting the closeclick event, but it's not working.
{exp:channel:entries channel="branches" disable="member_data|pagination|categories|category_fields" limit="300"}
{!--{branch_location id="map"}--}
{exp:gmap:marker
id="map"
latitude="{branch_latitude}"
longitude="{branch_longitude}"
icon="/images/map-pin.png"
offsetY="-40"
offsetX="0"
geocode="false"
infobox="true"
clustering="true"
class="ui-infobox-dark"
closeBoxMargin="5px"
}
<div class="ui-infobox-content entry{entry_id}">
<h4>{title}</h4>
{branch_address} <br>
{branch_city} {branch_province} <br>
{branch_postcode} <br>
Work Phone: {branch_phone} <br>
Toll Free: {branch_toll_free} <br>
Fax Number: {branch_fax}
</div>
{/exp:gmap:marker}
{!--
// add active class to branch card to highlight it.
--}
{exp:gmap:event id="map"}
$('.block article.entry{entry_id}').addClass('active');
{/exp:gmap:event}
{exp:gmap:event id="map" event="closeclick"}
$('.block article.entry{entry_id}').removeClass('active');
{/exp:gmap:event}
{/exp:channel:entries}