Skip to content

Mouse events

Stoyan Bonchev edited this page Oct 24, 2021 · 1 revision

So far, the following events were added:

  • OnClick
  • OnDoubleClick
  • OnMouseDown
  • OnMouseUp
  • OnMouseOver
  • OnMouseOut
  • OnMouseMove
  • OnContextMenu
  • OnPreClick

Sample usage of it:

OverviewMap.OnMoveEnd += async (s, e) => 
{
    var mapCenter = await OverviewMap.GetCenter();
    var zoomLevel = await OverviewMap.GetZoom();

    MapOverviewViewModel.CenterX = mapCenter.Lat;
    MapOverviewViewModel.CenterY = mapCenter.Lng;
    MapOverviewViewModel.Zoom = zoomLevel;
    
    Console.WriteLine("Map moved");
};                


OverviewMap.OnClick += async (s, e) => {
    Console.WriteLine($"Clicked {e.LatLng}");
};

OverviewMap.OnDoubleClick+= async (s, e) => {
    Console.WriteLine($"Double Clicked {e.LatLng}");

Kudos for Timothy Parez.

Clone this wiki locally