ok so in this case this is not a viable solution because I need to change the list of markers on a user action (i.e. when page is already loaded).
^ I do not think that the plugin is working then. Here is what I am seeing:
-
On page load, I am loading 6 green icons on the map. They are correctly shown:
-
When a user clicks on a particular button on the screen, I clear the markers, I select a subset of those markers (3 of the 6) and show these 3 markers in red (from another, completely different, DB field).
-
But what happens is: the markers are cleared , the subset of the markers (showing 3 out of the original 6) are shown , but the map keeps the icons from the DB field used in the Page Load event . So I end up with 3 out of the 6 points selected but showing in the same original colour.
And the following error is showing in the console:
It looks like the plugin is not trying to re-load the new images but instead re-using the same list of icons defined on page load.