Conversation
|
Oh dear, I realised that I accidentally formatted some of the javascript with empty lines... It can be ignored if other changes are approved. |
|
Hi, can you please link me to an original MapLibre documentation, where it is used in this kind of way? It can be the MapLibre GL JS, js / ts file of the options implementation, thank you! |
It is not directly bound to the options object of MarkerOptions for the maplibre ts, on the documentation (line 127 on marker.ts) it seems it inherits all event methods through "Marker extends Evented". Within Marker it has a listens() method that checks whether there are any instances of Evented: MarkerOptions seemed to be the main thing we access when we want to customize it, so it felt right to add it as an option parameter that can be bound to directly. Otherwise it would be for the Marker object itself, which is empty at the moment. Thoughts? Do you think we should follow a more 1:1 approach instead? |
|
Did the thumbs up mean that it is good enough as an implementation or that we should follow the second approach mentioned? @MatejMa2ur |

I added event handling support for the markers, so basically click, drag, dragstart and dragend events through marker options.
I put some remarks telling cases when the handlers does not work, for instance "OnClick" will override Popup content as an example. Also obviously OnDrag won't work together when Draggable is set to false, but I put them as remarks either way.
Let me know if there is some confusion or any changes that has to be done.
Overall changelog: