angular-openlayers-directive icon indicating copy to clipboard operation
angular-openlayers-directive copied to clipboard

Dynamically change marker on click event.

Open bharathnav opened this issue 9 years ago • 3 comments

Hi,

If there are multiple markers say(2 markers on the map) and when I click on one marker I want to change the image icon of that. For example I have two markers(both green coloured) and when I click on one Marker I want to change the icon so that I can differentiate with others. Do you have any such dynamic API to achieve things.

Also I have one more query: This is regarding message labels of markers. Can we control message labels of markers programatically. For example I want to highlight one markers message out of 10 but marking the property show: true is not working when there are multiple markers. The reason its not working is that when there are multiple markers and when we try to plot them, the marker with property show: true should be plotted last so that we can see the message. Else we cannot. Any fix available for this?

bharathnav avatar Mar 15 '16 10:03 bharathnav

Hi, I think it is currently not possible via the api, because I think it doesn't watch the style in the properties and update it on change.. It would be good if that was implemented. I have a quick and dirty solution I'm currently using, I remove the marker on click, update the style and add it back. Example fiddle here: http://jsfiddle.net/anushamc/5kd16wy7/, click on the marker over london to change the icon.

anushamc avatar Apr 12 '16 15:04 anushamc

Hi Anusha, thanks for the your time and solution. Currently I'm doing it somewhat the same way but not exactly way you are doing. But I'm expecting an API where it allows us to do the above mentioned things in a much better way. The reason is I also want to popup a message where in the current implementation its not feasible. The message/popup would be ignored on looping the markers.

bharathnav avatar Apr 14 '16 14:04 bharathnav

+1

generics avatar Aug 13 '16 15:08 generics