本文整理汇总了C#中ESRI.DirectlyOver方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.DirectlyOver方法的具体用法?C# ESRI.DirectlyOver怎么用?C# ESRI.DirectlyOver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESRI
的用法示例。
在下文中一共展示了ESRI.DirectlyOver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyMap_MapGesture
private void MyMap_MapGesture(object sender, ESRI.ArcGIS.Client.Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Tap)
{
FeatureLayer featureLayer = MyMap.Layers["MyFeatureLayer"] as FeatureLayer;
IEnumerable<Graphic> selected = e.DirectlyOver(10, new GraphicsLayer[] { featureLayer });
foreach (Graphic g in selected)
{
MyInfoWindow.Anchor = e.MapPoint;
MyInfoWindow.IsOpen = true;
//Since a ContentTemplate is defined (in XAML), Content will define the DataContext for the ContentTemplate
MyInfoWindow.Content = g;
return;
}
InfoWindow window = new InfoWindow()
{
Anchor = e.MapPoint,
Padding = new Thickness(3),
Map = MyMap,
IsOpen = true,
Placement = InfoWindow.PlacementMode.Auto,
ContentTemplate = LayoutRoot.Resources["LocationInfoWindowTemplate"] as System.Windows.DataTemplate,
//Since a ContentTemplate is defined, Content will define the DataContext for the ContentTemplate
Content = new ESRI.ArcGIS.Client.Geometry.MapPoint(
double.Parse(e.MapPoint.X.ToString("0.000")),
double.Parse(e.MapPoint.Y.ToString("0.000")))
};
LayoutRoot.Children.Add(window);
}
}
示例2: MyMap_MapGesture
private void MyMap_MapGesture(object sender, ESRI.ArcGIS.Client.Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Hold)
{
FeatureLayer featureLayer = MyMap.Layers["MyFeatureLayer"] as FeatureLayer;
IEnumerable<Graphic> selected = e.DirectlyOver(10, new GraphicsLayer[] { featureLayer });
foreach (Graphic g in selected)
{
MyInfoWindow.Anchor = e.MapPoint;
MyInfoWindow.IsOpen = true;
MyInfoWindow.Content = g;
return;
}
}
else if (e.Gesture == GestureType.Tap)
MyInfoWindow.IsOpen = false;
}
示例3: MyMap_MapGesture
private void MyMap_MapGesture(object sender, ESRI.ArcGIS.Client.Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Tap && !MyDrawObject.IsEnabled)
{
MyInfoWindow.IsOpen = false;
GraphicsLayer pointsGraphicsLayer = MyMap.Layers["MyPointGraphicsLayer"] as GraphicsLayer;
GraphicsLayer polygonsGraphicsLayer = MyMap.Layers["MyPolygonGraphicsLayer"] as GraphicsLayer;
IEnumerable<Graphic> selected = e.DirectlyOver(10, new GraphicsLayer[] { pointsGraphicsLayer, polygonsGraphicsLayer });
foreach (Graphic g in selected)
{
MyInfoWindow.Anchor = e.MapPoint;
MyInfoWindow.IsOpen = true;
MyInfoWindow.Content = g;
return;
}
}
}