本文整理汇总了C#中Map.DirectlyOver方法的典型用法代码示例。如果您正苦于以下问题:C# Map.DirectlyOver方法的具体用法?C# Map.DirectlyOver怎么用?C# Map.DirectlyOver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.DirectlyOver方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyMap_MapGesture
private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Tap)
{
var tapGraphic = e.DirectlyOver(10).FirstOrDefault();
if (tapGraphic != null)
{
MyInfoWindow.DataContext = tapGraphic.Attributes;
MyInfoWindow.Anchor = e.MapPoint;
MyInfoWindow.IsOpen = true;
}
}
}
示例2: MyMap_MapGesture
private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Tap)
{
MyInfoWindow.IsOpen = false;
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
IEnumerable<Graphic> selected = e.DirectlyOver(10, new GraphicsLayer[] { graphicsLayer });
foreach (Graphic g in selected)
{
MyInfoWindow.Anchor = e.MapPoint;
MyInfoWindow.IsOpen = true;
MyInfoWindow.DataContext = g;
return;
}
}
}
示例3: MyMap_MapGesture
private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString() + e.Gesture.ToString());
if (e.Gesture == GestureType.Tap || e.Gesture == GestureType.Hold)
{
List<Graphic> results = new List<Graphic>(e.DirectlyOver(10));
if (results.Count == 0)
MyInfoWindow.IsOpen = false;
else
{
_tapGraphic = results[0];
_dispatcherTimer.Start();
}
}
else if (e.Gesture == GestureType.DoubleTap)
{
_dispatcherTimer.Stop();
}
}
示例4: MyMap_MapGesture
private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Hold)
{
FeatureLayer featureLayer = MyMap.Layers["SaveTheBayMarineLayer"] as FeatureLayer;
IEnumerable<Graphic> selected = e.DirectlyOver(10, new GraphicsLayer[] { featureLayer });
foreach (Graphic g in selected)
{
InfoWindow.Anchor = e.MapPoint;
InfoWindow.IsOpen = true;
InfoWindow.Content = g;
return;
}
}
else
InfoWindow.IsOpen = false;
}
示例5: Map_MapGesture
private void Map_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (!displayAttribute || editor == null || !editor.GraphicsLayers.Any(l => l is FeatureLayer))
return;
if (e.Gesture != GestureType.Tap)
return;
var featureLayers = from l in editor.GraphicsLayers
where l is FeatureLayer
select l as FeatureLayer;
var graphics = e.DirectlyOver(TAP_TOLERANCE, featureLayers);
if (graphics != null && graphics.GetEnumerator().MoveNext())
{
var graphic = graphics.First();
FeatureLayer layer = null;
if (graphic == null) return;
foreach (var l in featureLayers)
{
if (l.Graphics == null)
return;
if (l.Graphics.Contains(graphic))
{
layer = l;
break;
}
}
if (layer != null)
{
e.Handled = true;
TemplatePicker.ShowAttributeForm(layer, graphic);
this.displayAttribute = this.Continuous;
}
}
}
示例6: MyMap_MapGesture
private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Tap &&
!facilitiesEditor.CancelActive.CanExecute(null) &&
!incidentsEditor.CancelActive.CanExecute(null) &&
!barriersEditor.CancelActive.CanExecute(null))
{
MyRouteInfoWindow.IsOpen = false;
GraphicsLayer graphicsLayer = MyMap.Layers["MyRoutesGraphicsLayer"] as GraphicsLayer;
IEnumerable<Graphic> selected = e.DirectlyOver(10, new GraphicsLayer[] { graphicsLayer });
foreach (Graphic g in selected)
{
MyRouteInfoWindow.Anchor = e.MapPoint;
MyRouteInfoWindow.IsOpen = true;
MyRouteInfoWindow.DataContext = g;
return;
}
}
}
示例7: MyMap_MapGesture
private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (isAdd)
return;
// open the feature dialog on tap of a feature
if (e.Gesture == GestureType.Tap)
{
IEnumerable<Graphic> graphics = e.DirectlyOver(10, new GraphicsLayer[] { featureLayer } );
foreach (Graphic graphic in graphics)
{
// if editable, make the editable fields enabled. Otherwise disable them
if (featureLayer.IsUpdateAllowed(graphic))
{
RotationTB.IsEnabled = true;
DescriptionTB.IsEnabled = true;
DateTB.IsEnabled = true;
TypeButton.IsEnabled = true;
}
else
{
RotationTB.IsEnabled = false;
DescriptionTB.IsEnabled = false;
DateTB.IsEnabled = false;
TypeButton.IsEnabled = false;
}
// show the attribute page for the first of the graphics returned
FeatureInfoPage.IsOpen = true;
ApplicationBar.IsVisible = false;
FeatureInfoPage.DataContext = graphic;
// select the type value in the ListBoxes to match the graphic's attributes
var typeMatches = FeatureTypeListBox.Items.Where(a => (a as TemplateItem).ID.Equals(graphic.Attributes["eventtype"]));
if (typeMatches.Any())
FeatureTypeListBox.SelectedItem = typeMatches.First();
return;
}
}
// move a held feature
if (e.Gesture == GestureType.Hold)
{
IEnumerable<Graphic> graphics = e.DirectlyOver(10, new GraphicsLayer[] { featureLayer } );
foreach (Graphic graphic in graphics)
{
if (graphic != null && !graphic.Selected && featureLayer.IsUpdateAllowed(graphic))
{
Editor editor = LayoutRoot.Resources["MyEditor"] as Editor;
if (featureLayer.IsUpdateAllowed(graphic))
{
if (editor.EditVertices.CanExecute(null))
editor.EditVertices.Execute(null);
}
else
if (editor.CancelActive.CanExecute(null))
editor.CancelActive.Execute(null);
}
featureLayer.ClearSelection();
graphic.Select();
}
}
}