Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class DragEndEvent for dragend listener (Suggestion) #321

Closed
jacksonsfaria opened this issue Mar 20, 2024 · 1 comment
Closed

Add class DragEndEvent for dragend listener (Suggestion) #321

jacksonsfaria opened this issue Mar 20, 2024 · 1 comment

Comments

@jacksonsfaria
Copy link

Returned by drangend listener
{"latLng":{"lat":-23.703340477909656,"lng":-46.869214057922356},"domEvent":{"isTrusted":true},"pixel":{"x":108,"y":-50}}

// I didn't find this class on [BlazorGoogleMaps](https://github.com/rungwiroon/BlazorGoogleMaps)
 public class DomEvent
 {
     public bool IsTrusted { get; set; }
 }

// Class for AddListener dragend
 public class DragEndEvent
 {
     public LatLngLiteral LatLng { get; set; }
     public Point Pixel { get; set; }
     public DomEvent DomEvent { get; set; }
 }

How use...
await marker.AddListener<DragEndEvent>("dragend", (e) => OnDragEndDistribution(e));

public void OnDragEndDistribution(DragEndEvent e)
{
      Console.WriteLine(e.LatLng.Lat + " " + e.LatLng.Lng);
}
@valentasm1
Copy link
Collaborator

Added to. Thank you for suggestion
https://www.nuget.org/packages/BlazorGoogleMaps/4.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants