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


C# GraphicsLayer.SetValue方法代码示例

本文整理汇总了C#中GraphicsLayer.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsLayer.SetValue方法的具体用法?C# GraphicsLayer.SetValue怎么用?C# GraphicsLayer.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsLayer的用法示例。


在下文中一共展示了GraphicsLayer.SetValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetGeometryType

 public static void SetGeometryType(GraphicsLayer graphicsLayer, GeometryType value)
 {
     if (graphicsLayer == null)
     {
         throw new ArgumentNullException("graphicsLayer");
     }
     graphicsLayer.SetValue(GeometryTypeProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:8,代码来源:LayerExtensions.cs

示例2: CreateGraphicsLayer

        /// <summary>
        /// Converts a single graphic "note" element into a graphics layer.
        /// </summary>
        /// <param name="name">The name to assign to the graphics layer.</param>
        /// <param name="graphic">The graphic element to add to the graphics layer.</param>
        /// <param name="map">The map to which the layer will eventually be added, to prevent name conflicts with existing layers.</param>
        /// <returns>A graphics layer that contains the graphic element.</returns>
        public static GraphicsLayer CreateGraphicsLayer(string name, Graphic graphic, Map map)
        {
            graphic.Attributes["Name"] = name;
            GraphicsLayer graphicsLayer = new GraphicsLayer();
            graphicsLayer.ID = name;
            if (string.IsNullOrEmpty(graphicsLayer.ID) || (!string.IsNullOrEmpty(graphicsLayer.ID) && map.Layers[graphicsLayer.ID] != null))
                graphicsLayer.ID = Guid.NewGuid().ToString("N");
            graphicsLayer.Graphics.Add(graphic);
            graphicsLayer.Renderer = new ESRI.ArcGIS.Mapping.Core.Symbols.HiddenRenderer();
            graphicsLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.MapApplication.LayerNameProperty, name);

            Collection<FieldInfo> fields = new Collection<FieldInfo>();
            fields.Add(new FieldInfo()
            {
                Name = "Name",
                VisibleInAttributeDisplay = true,
                DisplayName = "Name",
                FieldType = FieldType.Text,
                VisibleOnMapTip = false
            });
            ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetFields(graphicsLayer, fields);
            return graphicsLayer;
        }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:30,代码来源:Note.cs

示例3: AddResultLayer

 private void AddResultLayer(GraphicsLayer resultsLayer, bool isSelected, string displayName,
     ESRI.ArcGIS.Mapping.Core.GeometryType geometryType, int? index)
 {
     resultsLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.MapApplication.LayerNameProperty, displayName);
     resultsLayer.ID = displayName;
     resultsLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.LayerExtensions.InitialUpdateCompletedProperty, true);
     if (index == null || index.Value < 0 || index.Value >= Map.Layers.Count)
         Map.Layers.Add(resultsLayer);
     else
         Map.Layers.Insert(index.Value, resultsLayer);
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:11,代码来源:FindNearbyCommand.cs

示例4: addInput

        void addInput(ESRI.ArcGIS.Client.Geometry.Geometry geometry)
        {
            GraphicsLayer layer = getLayer();

            #region Create layer if not already there and add to map
            if (layer == null)
            {
                InputLayerID = Guid.NewGuid().ToString("N");
                layer = new GraphicsLayer();
                if (config.Layer != null)
                {
                    layer.Renderer = config.Layer.Renderer;
                    Core.LayerExtensions.SetFields(layer, Core.LayerExtensions.GetFields(config.Layer));
                    Core.LayerExtensions.SetGeometryType(layer, Core.LayerExtensions.GetGeometryType(config.Layer));
                    Core.LayerExtensions.SetDisplayField(layer, Core.LayerExtensions.GetDisplayField(config.Layer));
                    Core.LayerExtensions.SetPopUpsOnClick(layer, Core.LayerExtensions.GetPopUpsOnClick(config.Layer));
                    LayerProperties.SetIsPopupEnabled(layer, LayerProperties.GetIsPopupEnabled(config.Layer));
                }
                layer.ID = InputLayerID;

                layer.SetValue(MapApplication.LayerNameProperty,
                    string.IsNullOrEmpty(config.LayerName) ? 
                        string.IsNullOrEmpty(config.Label) ? config.Name : config.Label
                        : config.LayerName);
                layer.Opacity = config.Opacity;
                Map.Layers.Add(layer);
            }
            #endregion

            #region Add geometry to layer
            if (config.GeometryType == Core.GeometryType.MultiPoint) // Special handling for MultiPoint geometry
            {
                if (layer.Graphics.Count == 0) 
                {
                    // Create a new MultiPoint geometry and add the passed-in point to it
                    var multipoint = new MultiPoint() { SpatialReference = geometry.SpatialReference };
                    multipoint.Points.Add((MapPoint)geometry);
                    var g = new Graphic() { Geometry = multipoint };
                    layer.Graphics.Add(g);
                }
                else
                {
                    // Get the sketch graphic's MultiPoint geometry and add the passed-in point to it
                    var multipoint = (MultiPoint)layer.Graphics[0].Geometry;
                    multipoint.Points.Add((MapPoint)geometry);
                    layer.Refresh();
                }
            }
            else
            {
                Graphic g = new Graphic() { Geometry = geometry };
                layer.Graphics.Add(g);
            }
            #endregion
        }
开发者ID:yulifengwx,项目名称:arcgis-viewer-silverlight,代码行数:55,代码来源:SketchLayerParameter.cs

示例5: addInput

        void addInput(ESRI.ArcGIS.Client.Geometry.Geometry geometry)
        {
            GraphicsLayer layer = getLayer();

            #region Create layer if not already there and add to map
            if (layer == null)
            {
                InputLayerID = Guid.NewGuid().ToString("N");
                layer = new GraphicsLayer();
                if (config.Layer != null)
                {
                    layer.Renderer = config.Layer.Renderer;
                    Core.LayerExtensions.SetFields(layer, Core.LayerExtensions.GetFields(config.Layer));
                    Core.LayerExtensions.SetGeometryType(layer, Core.LayerExtensions.GetGeometryType(config.Layer));
                    Core.LayerExtensions.SetDisplayField(layer, Core.LayerExtensions.GetDisplayField(config.Layer));
                    Core.LayerExtensions.SetPopUpsOnClick(layer, Core.LayerExtensions.GetPopUpsOnClick(config.Layer));
                    LayerProperties.SetIsPopupEnabled(layer, LayerProperties.GetIsPopupEnabled(config.Layer));
                }
                layer.ID = InputLayerID;

                layer.SetValue(MapApplication.LayerNameProperty,
                    string.IsNullOrEmpty(config.LayerName) ? 
                        string.IsNullOrEmpty(config.Label) ? config.Name : config.Label
                        : config.LayerName);
                layer.Opacity = config.Opacity;
                Map.Layers.Add(layer);
            }
            #endregion

            #region Add geometry to layer
            Graphic g = new Graphic() { Geometry = geometry };
            layer.Graphics.Add(g);
            #endregion
        }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:34,代码来源:SketchLayerParameter.cs

示例6: SetIsMapTipDirty

 public static void SetIsMapTipDirty(GraphicsLayer graphicsLayer, bool value)
 {
     graphicsLayer.SetValue(IsMapTipDirtyProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:4,代码来源:LayerExtensions.cs

示例7: SetDataset

 /// <summary>
 /// Sets the value of the Dataset attached property to a specified GraphicsLayer.
 /// </summary>
 /// <param name="layer">The GraphicsLayer to which the attached property is written.</param>
 /// <param name="value">The needed Dataset value.</param>
 public static void SetDataset(GraphicsLayer layer, string value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("element");
     }
     layer.SetValue(DatasetProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:13,代码来源:LayerExtensions.cs

示例8: SetRunLayerPostInitializationActions

 public static void SetRunLayerPostInitializationActions(GraphicsLayer layer, bool value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     if (value)
         layer.SetValue(RunLayerPostInitializationActionsProperty, value);
     else
         layer.ClearValue(RunLayerPostInitializationActionsProperty);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:11,代码来源:LayerExtensions.cs

示例9: SetRendererAttributeDisplayName

 /// <summary>
 /// Sets the value of the RendererAttributeDisplayName attached property to a specified GraphicsLayer.
 /// </summary>
 /// <param name="element">The GraphicsLayer to which the attached property is written.</param>
 /// <param name="value">The needed RendererAttributeDisplayName value.</param>
 public static void SetRendererAttributeDisplayName(GraphicsLayer element, string value)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(RendererAttributeDisplayNameProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:13,代码来源:LayerExtensions.cs

示例10: SetGradientBrush

 /// <summary>
 /// Sets the value of the GradientBrush attached property to a specified GraphicsLayer.
 /// </summary>
 /// <param name="graphicsLayer">The GraphicsLayer to which the attached property is written.</param>
 /// <param name="value">The needed GradientBrush value.</param>
 public static void SetGradientBrush(GraphicsLayer graphicsLayer, LinearGradientBrush value)
 {
     if (graphicsLayer == null)
     {
         throw new ArgumentNullException("graphicsLayer");
     }
     graphicsLayer.SetValue(GradientBrushProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:13,代码来源:LayerExtensions.cs

示例11: SetDisplayField

 public static void SetDisplayField(GraphicsLayer graphicsLayer, string value)
 {
     graphicsLayer.SetValue(DisplayFieldProperty, value);
     SetIsMapTipDirty(graphicsLayer, true);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:5,代码来源:LayerExtensions.cs

示例12: SetFields

 public static void SetFields(GraphicsLayer graphicsLayer, Collection<FieldInfo> value)
 {
     graphicsLayer.SetValue(FieldsProperty, value);
     SetIsMapTipDirty(graphicsLayer, true);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:5,代码来源:LayerExtensions.cs

示例13: SetPopUpsOnClick

 public static void SetPopUpsOnClick(GraphicsLayer layer, bool value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(PopUpsOnClickProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:8,代码来源:LayerExtensions.cs


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