Hi,
Needed to store the Lat/Long of the location the user clicks on, was a bit of a struggle to figure this out but proved to be rather simple to do.
1. in load.js add a listener that calls an outsystems action
function onMapClick(e) { $actions.ProcessMapClick(e.latlng.lat, e.latlng.lng, mapjs.getZoom())}
mapjs.on('click', onMapClick);
2. The ProcessMapClick action triggers an event MapClicked
3. In you application define an action to handle the event
Also added a OnParametersChanged action to synchronize the view with updated info from the database. OnReady triggers before data is loaded.
Added the Marker layer to OnParametersChanged