当前位置: 首页>>代码示例>>C#>>正文


C# Map.DirectlyOver方法代码示例

本文整理汇总了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;
         }
     }
 }
开发者ID:jNery,项目名称:aggregate_hotspots_wp8,代码行数:13,代码来源:MainPage.xaml.cs

示例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;
                }
            }
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:17,代码来源:GeoRSS.xaml.cs

示例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();
            }
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:20,代码来源:InfoWindowChildPage.xaml.cs

示例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;
 }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:17,代码来源:OwnershipBasedEditing.xaml.cs

示例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;
         }
     }
 }
开发者ID:Esri,项目名称:arcgis-toolkit-sl-wpf,代码行数:33,代码来源:EditorWidget.cs

示例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;
                }
            }
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:20,代码来源:ClosestFacility.xaml.cs

示例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();
                }
            }
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:65,代码来源:EditorTracking.xaml.cs


注:本文中的Map.DirectlyOver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。