mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Test WMS FeatureInfo
This commit is contained in:
parent
c404fd2a90
commit
fe1ac924b4
|
|
@ -107,6 +107,7 @@
|
|||
|
||||
<map:Map x:Name="map" ManipulationMode="All"
|
||||
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11"
|
||||
PointerPressed="MapPointerPressed"
|
||||
PointerMoved="MapPointerMoved"
|
||||
PointerExited="MapPointerExited">
|
||||
<map:Map.Center>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
using MapControl.Caching;
|
||||
using MapControl.UiTools;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Input;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -100,6 +102,20 @@ namespace SampleApplication
|
|||
map.TargetHeading = 0d;
|
||||
}
|
||||
|
||||
private async void MapPointerPressed(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
if (map.MapLayer is WmsImageLayer wmsLayer &&
|
||||
e.Pointer.PointerDeviceType == PointerDeviceType.Mouse)
|
||||
{
|
||||
PointerPoint point = e.GetCurrentPoint(map);
|
||||
|
||||
if (point.Properties.IsRightButtonPressed)
|
||||
{
|
||||
Debug.WriteLine(await wmsLayer.GetFeatureInfoAsync(point.Position));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MapPointerMoved(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
var location = map.ViewToLocation(e.GetCurrentPoint(map).Position);
|
||||
|
|
|
|||
|
|
@ -75,14 +75,6 @@ namespace SampleApplication
|
|||
map.TargetHeading = 0d;
|
||||
}
|
||||
|
||||
private async void MapMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (map.MapLayer is WmsImageLayer wmsLayer)
|
||||
{
|
||||
Debug.WriteLine(await wmsLayer.GetFeatureInfoAsync(e.GetPosition(map)));
|
||||
}
|
||||
}
|
||||
|
||||
private void MapMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ClickCount == 2)
|
||||
|
|
@ -91,6 +83,14 @@ namespace SampleApplication
|
|||
}
|
||||
}
|
||||
|
||||
private async void MapMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (map.MapLayer is WmsImageLayer wmsLayer)
|
||||
{
|
||||
Debug.WriteLine(await wmsLayer.GetFeatureInfoAsync(e.GetPosition(map)));
|
||||
}
|
||||
}
|
||||
|
||||
private void MapMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
var location = map.ViewToLocation(e.GetPosition(map));
|
||||
|
|
|
|||
Loading…
Reference in a new issue