Beispiel #1
0
        static public Symbol GetSymbol(GeoMarkerType type, GeoStatus status)
        {
            if (type == GeoMarkerType.Point)
            {
                return(new SimpleMarkerSymbol()
                {
                    Style = DefaultMarkerStyle, Color = DefaultSettings.GetColor(status), Size = DefaultMarkerSize
                });
            }
            else if (type == GeoMarkerType.Line)
            {
                return(new SimpleLineSymbol()
                {
                    Style = DefaultLineStyle, Color = DefaultSettings.GetColor(status), Width = DefaultLineWidth
                });
            }
            else if (type == GeoMarkerType.Fill)
            {
                return(new SimpleFillSymbol()
                {
                    Style = DefaultFillStyle,
                    Color = status == GeoStatus.Hilight ? Colors.Gold : DefaultSettings.GetColor(status),
                    Outline = new SimpleLineSymbol()
                    {
                        Style = SimpleLineStyle.Solid, Color = DefaultSettings.GetColor(status), Width = DefaultLineWidth
                    }
                });
            }

            return(null);
        }
Beispiel #2
0
 public MarkerSymbol GetProportionalSymbol(int count, GeoStatus status)
 {
     return(new SimpleMarkerSymbol()
     {
         Style = SimpleMarkerStyle.Circle, Color = DefaultSettings.GetColor(status), Size = MinSize + StepSize * Math.Min(count, MaxNumber)
     });
 }
Beispiel #3
0
        public MarkerSymbol GetSymbol(GeoStatus status)
        {
            if (PictureMarkerSymbols != null)
            {
                return(PictureMarkerSymbols[status]);
            }

            return(new SimpleMarkerSymbol()
            {
                Style = DefaultStyle, Color = DefaultSettings.GetColor(status), Size = DefaultSize
            });
        }
Beispiel #4
0
        static public Symbol GetSymbol(GeoMarkerType type, GeoStatus status)
        {
            if (type == GeoMarkerType.Point)
            {
                return(new SimpleMarkerSymbol()
                {
                    Style = DefaultMarkerStyle, Color = DefaultSettings.GetColor(status), Size = DefaultMarkerSize
                });
            }
            else if (type == GeoMarkerType.Line)
            {
                return(new SimpleLineSymbol()
                {
                    Style = DefaultLineStyle, Color = DefaultSettings.GetColor(status), Width = DefaultLineWidth
                });
            }

            return(null);
        }
 void HilightItem(Graphic graphic, Layer layer)
 {
     if (layer.Info is MapPointLayer)
     {
         graphic.Symbol = MapPointLayer.GetSymbol(GeoStatus.Hilight);
     }
     else if (layer.Info is MapShapeLayer)
     {
         var code = graphic.Attributes[KEY_CODE];
         var list = layer.GraphicsLayer.Graphics.Where(x => x.Attributes[KEY_CODE].ToString() == code.ToString());
         list.ToList().ForEach(g =>
         {
             if (g.Geometry is MapPoint)
             {
                 g.Symbol = MapShapeLayer.GetSymbol(GeoMarkerType.Point, GeoStatus.Hilight);
             }
             else
             {
                 g.Symbol = MapShapeLayer.GetSymbol(GeoMarkerType.Fill, GeoStatus.Hilight);
             }
         });
     }
     else if (layer.Info is MapLineLayer)
     {
         graphic.Symbol = MapLineLayer.GetSymbol(GeoMarkerType.Line, GeoStatus.Hilight);
     }
     else if (layer.Info is MapEventLayer)
     {
         if (layer.Info.ConvertTo <MapEventLayer>().MarkerType == EventMarkerType.Proportional)
         {
             (graphic.Symbol as SimpleMarkerSymbol).Color = DefaultSettings.GetColor(GeoStatus.Hilight);
         }
         else
         {
             graphic.Symbol = layer.Info.ConvertTo <MapEventLayer>().GetSymbol(GeoStatus.Hilight);
         }
     }
 }
 void SetAllNormal(Layer layer)
 {
     if (layer.Info is MapPointLayer)
     {
         layer.GraphicsLayer.Graphics.ToList().ForEach(g => g.Symbol = MapPointLayer.GetSymbol(GeoStatus.Normal));
     }
     else if (layer.Info is MapShapeLayer)
     {
         layer.GraphicsLayer.Graphics.ToList().ForEach(g =>
         {
             if (g.Geometry is MapPoint)
             {
                 g.Symbol = MapShapeLayer.GetSymbol(GeoMarkerType.Point, GeoStatus.Normal);
             }
             else
             {
                 g.Symbol = MapShapeLayer.GetSymbol(GeoMarkerType.Fill, GeoStatus.Normal);
             }
         });
     }
     else if (layer.Info is MapLineLayer)
     {
         layer.GraphicsLayer.Graphics.ToList().ForEach(g => g.Symbol = MapLineLayer.GetSymbol(GeoMarkerType.Line, GeoStatus.Normal));
     }
     else if (layer.Info is MapEventLayer)
     {
         if ((layer.Info.ConvertTo <MapEventLayer>()).MarkerType == EventMarkerType.Proportional)
         {
             layer.GraphicsLayer.Graphics.ToList().ForEach(g => (g.Symbol as SimpleMarkerSymbol).Color = DefaultSettings.GetColor(GeoStatus.Normal));
         }
         else
         {
             layer.GraphicsLayer.Graphics.ToList().ForEach(g => g.Symbol = (layer.Info.ConvertTo <MapEventLayer>().GetSymbol(GeoStatus.Normal)));
         }
     }
 }