How to set ID of the marker that was clicked in the new Leaflet maps?

Maybe am being a little bit tired is making me miss the obvious but how do you retrieve the id of the marker that is clicked? ie, as we can do with the Calendar event, so we can use it to pass to an input etc.

Any help well appreciated.

... I thought, being cocky, that if I set the inputs selectedLatitude and selectedLongitude I could do a query on the backend (scruffy I know but would have filtered) to find the data I wanted... Set the Action up and added the filters. Clicked on a marker and it gave me the DAMN marker click latitude and longitude not the actual markers latitude and longitude from the source (I slapped myself)...

Feature or bug hahahaha? I mean if it is default for Leaflet behaviour I can understand that but if not its a bug and not a feature.

:smiley:

Maybe add event click data similar to google maps, so that the marker id can be returned.

@Cheese Did you manage to bind an on click event to the marker?
I don't seem to be able to bind the marker id to a browser.goto url.

Try using $event.id in your expression

1 Like

Thank you kindly @patrick that worked fine for me.

Using Patrick's above solution has worked.

Sorry. like this?

dmx-on:click="browserCRM.goto('http://myserver/customer?customerid=$event.id')"