Quick update to let you know I have not yet received feedback from my 2nd tier support team, their queue is a bit loaded at the moment so it could be a bit longer than expected.
One thing I could do, if I knew how, is instead of just changing the icon, is to delete the marker and create another identical one
Not quite sure I understand what you mean here. If you're talking about manipulating the map markers programmatically using the Google Maps JavaScript API, that type of customization is pretty advanced and falls outside the scope of support we offer here. With that being said, if you understand the JavaScript involved here, you can access the Google Maps JS Marker objects once the map is rendered as follows:
WPViews.view_addon_maps.markers["mapid"]
Replace mapid with the actual map ID. This object contains all the marker objects displayed in the map, organized by key, where the key corresponds to each unique marker ID. See the second screenshot showing the console logs for a simple map with markers.
The first screenshot shows how you can access the available event hooks for Toolset Maps in a legacy View editor. In the Search and Pagination panel, you can expand the JS editor area to expose a button "Front-end Events". Click that button and choose the Maps tab in the popup, then you can see the various event hooks available for the map rendering lifecycle. Check one or more checkbox to insert the scaffolding for an event hook. Inside that hook callback function you can trigger your own custom code to manipulate the marker objects as needed.
Marker reference:
https://developers.google.com/maps/documentation/javascript/markers
I'll keep you posted as I receive more information from my 2nd tier team.
After discussion with our developers, the second tier team has provided some feedback. The problem is not one of Google Maps caching, but one of the timing in evaluating custom shortcodes:
The mechanism to allow shortcodes as shortcode attributes evaluates the attribute-shortcodes with a lower priority (i.e. sooner), so the Types field shortcode used as an icon attribute for the wpv-map-marker shortcode is evaluated before the custom switcher shortcode.
That does open up an avenue for a solution for you.
You could move the logic for switching the icon source into a custom shortcode which is used as the source of the marker_icon attribute, which will be evaluated before other normal shortcodes in the same loop.
You will need to remember to register the custom shortcode in Toolset > Settings > Front-end Content: 3rd-party shortcode arguments.
I hope this helps explain the timing problem and a possible workaround. Let me know if you have questions about this.
My issue is resolved now. Thank you!