ichim / LeafletForBlazor-NuGet

LeafletForBlazor NuGet Package - You can quickly add a map control to your Blazor application - 2.2.2.2 version. #12 issue, StreamLegend customization
https://www.nuget.org/packages/LeafletForBlazor#versions-body-tab
74 stars 9 forks source link

OnMouseMove event #40

Closed Hayame closed 4 months ago

Hayame commented 4 months ago

Hi, I would like to implement the ability to draw a line on a map. The user selects a starting point, and then a line is drawn from that point. The shape of this line will update as the mouse moves. Is there a way to hook into the OnMouseMove event to get current mouse location?

ichim commented 4 months ago

Hello sir,

Both, OnMouseDownMap and OnMouseDownMap return location of the click point:

//Blazor Page //Code block @code{ public void onMouseDownMap(RealTimeMap.ClicksMapArgs value) { //where value.sender is RealTimeMap control reference Console.WriteLine(value.location.latitude); Console.WriteLine(value.location.longitude); } }

Hayame commented 4 months ago

Than you for an answer. Yeah, these one I know, but the idea is to show user how long is the line he wants to draw and how it will look on the map, so I need cords of mouse in real time to redraw the line on a mouse move, not only when he clicks on the map.

Ps. I closed the issue by accident >.<

ichim commented 4 months ago

Hello sir, I understand, in this case a new OnMouseMoveMap event would be needed. This event will need to return location on mouse movement. I will add this event on future version(s).

ichim commented 3 months ago

Hello sir, Version 2.0.8.8 is available. In this version you will find the OnMouseMove event (issue #40).

https://www.nuget.org/packages/LeafletForBlazor/2.0.8.8