public MarkerSymbol GetProportionalSymbol(int count, GeoStatus status) { return(new SimpleMarkerSymbol() { Style = SimpleMarkerStyle.Circle, Color = DefaultSettings.GetColor(status), Size = MinSize + StepSize * Math.Min(count, MaxNumber) }); }
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); }
public MarkerSymbol GetSymbol(GeoStatus status) { if (PictureMarkerSymbols != null) { return(PictureMarkerSymbols[status]); } return(new SimpleMarkerSymbol() { Style = DefaultStyle, Color = DefaultSettings.GetColor(status), Size = DefaultSize }); }
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); }
public void NoMoreLayer() { eventMarker.Visibility = _layerList.Any(x => x.Info is MapEventLayer) ? Visibility.Visible : Visibility.Hidden; Envelope viewArea = null; _shapeList.ForEach(g => viewArea = viewArea?.Union(g) ?? g); double margin = (viewArea == null) ? DefaultSettings.MarginForPoint : DefaultSettings.MarginForShape; _pointList.ForEach(p => { var g = new Envelope(p.X - margin, p.Y - margin, p.X + margin, p.Y + margin, SpatialReferences.Wgs84); viewArea = viewArea?.Union(g) ?? g; }); viewArea = viewArea ?? DefaultSettings.GetRange(margin); mapView.SetViewAsync(new Viewpoint(viewArea.Expand(DefaultSettings.ExpandFactor))); attrInfo.Visibility = Visibility.Hidden; mapView.MapViewTapped += MapView_MapViewTapped; }
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))); } } }