Closed mmeinert closed 9 years ago
Michael, thanks for pointing this out.
I left it this way mostly because I was lazy. Leaflet markers, unlike other layers are based on images, and so there's no (easy) way to change the color of a marker using JavaScript alone, as with polylines, polygons, etc.
There are two good solutions to this:
I'm particularly interested in solution #2, because I think that it touches on an important use case. Any situation where the actions you want to expose to the user are dependent on the target object might fit this model. For example - users might have read privileges to all objects on a map, but they might only have edit privileges to those they created.
I experimented with a 'filter' option to Leaflet.Toolbar before, but didn't follow through. I think this is the perfect use-case for such an option! On Mar 18, 2015 9:30 AM, "Michaël Meinertzhagen" notifications@github.com wrote:
Hi,
Seems I can't edit color of a marker when selected. Same on your popup http://leaflet.github.io/Leaflet.toolbar/examples/popup.html example.
Do you think possible to make a list of 4 other markers in place changing his color ?
— Reply to this email directly or view it on GitHub https://github.com/Leaflet/Leaflet.toolbar/issues/25.
Hi @manleyjster, thank you for your answer. I'm currently learning JS, thanks to CodeAcademy and other ressources. This will help me to participate in projects like yours.
Hi,
Seems I can't edit color of a marker when selected. Same on your popup example.
Do you think possible to make a list of 4 other markers in place changing his color ?