Recently, I implemented a custom cluster HTML marker, where I attempted to dynamically change the color of my markers within the cluster. Despite debugging the code and confirming that the color variable was being updated correctly, the marker colors themselves remained unchanged.
To address this issue, I created a function called updateMarkers which is meant to refresh the clustering display.
As part of my troubleshooting process, I attempted to trigger the update by calling the updateMarkers function:
document.getElementById('update').addEventListener('click', function(){
updateMarkers(locations, markers, HTMLMarker, map, 'green');
})
Unfortunately, even after invoking the update function, the colors did not reflect the changes I intended.
I started by initializing the Google Map with specified settings and locations. A list of predefined coordinates was used in an attempt to create distinct clusters at different positions on the map. Additionally, I made an attempt to switch between red and green in order to visually identify the effect of these updates.