Leaflet used on TMSFNCMaps or TMSFNCLeaflet

Hello
When using leaflet maps behave incorrectly.

  1. I add a maker to the map (and clear the log window)

  2. I place the mouse cursor on the marker

  3. I right-click the marker and events appear (added to the beginning of the list)
    E - MapMouseUp
    D - MapMouseMove
    C - MapMouseMove
    B - MapMouseDown
    A - MarkerMouseDown

Where do the events C and D: MapMouseMove come from? They cause the marker to move even though I haven't made any mouse movement. How can I eliminate this situation? Clicking the marker should allow me to e.g. show additional information related to it). Now the MarkerClick event occurs when the marker is clicked very quickly (similar to the MarkerMouseUp event)
E - MarkerClick
D - MapMouseUp
C - MarkerMouseUp
B - MapMouseDown
A - MarkerMouseDown

Why is there no MarkerMouseUp event after clicking the marker and holding the button down and then releasing it - how can I drop the marker if I don't get the appropriate event?

Please solve the above problems urgently because they prevent me from working on the map.

I am attaching the program code

leaflet.zip (5.9 KB)

Hi,

The map/marker events have subtle differences between mapping services.
A MarkerClick in Leaflet always triggers a MapClick/MapMouseMove event as well, while this might not be the case in Google Maps for example.

More information on this behavior in Leaflet can be found here:

In your example you are changing the marker coordinates in the MapMouseMove event handler. In Leaflet this positions the marker outside of the cursor location. This means the MarkerMouseUp won't be triggered.

Implementing custom marker drag/drop code can be tricky. We recommend using the OnMarkerDragEnd event instead. However, please note that this event is currently only available in the TTMSFNCGoogleMaps and TTMSFNCLeaflet components, not in the TTMSFNCMaps component, as it is not supported by all mapping services.

Hello
I understand that different services work differently, but using TTMSFNCMaps I was hoping that at the component level the operation of different services is integrated, resulting in a predictably working component. Unfortunately, from what you wrote, it appears that each TMS user must do the integration themselves outside the component. Therefore, many individual solutions will be created, the errors of which will be sent to TMS for analysis.

Additionally - as I have already described in the report - after clicking on the marker, even without moving the mouse, WebMapMouseMove events appear - please provide a way to eliminate them.

From what I have noticed so far, the best and most predictable solution for me would be to use Google or Here maps with the possibility of inserting TileLayer. So again, please check the possibility of supporting TileLayer in TTMSFNCMaps.

How to protect against calling mouseMove without moving the cursor?

Please add this event to TMSFNCMAPS and use when service is setting to leaflet

1 Like