public Feature AddFeature(String Id, GeoCoordinate GeoCoordinate, Double Width, Double Height, Color Color) { var radialBrush = new RadialGradientBrush(); var ColorHigh = Color; ColorHigh.A = 0xFF; var ColorLow = Color; ColorLow.A = 0x00; radialBrush.GradientStops.Add(new GradientStop(ColorHigh, 0.0)); radialBrush.GradientStops.Add(new GradientStop(ColorLow, 1.0)); var XY = GeoCalculations.WorldCoordinates_2_Screen(GeoCoordinate.Latitude, GeoCoordinate.Longitude, ZoomLevel); var Feature = new Feature(new EllipseGeometry() { RadiusX = Width/2, RadiusY = Height/2 }); Feature.Id = Id; Feature.Latitude = GeoCoordinate.Latitude; Feature.Longitude = GeoCoordinate.Longitude; Feature.Width = Width; Feature.Height = Height; Feature.Fill = radialBrush; Feature.ToolTip = Id; // The position on the map will be set within the PaintMap() method! this.Children.Add(Feature); return Feature; }
public Feature AddFeature(String Id, GeoCoordinate GeoCoordinate, Double Width, Double Height, Color Color) { var Feature = new Feature(new EllipseGeometry() { RadiusX = Width/2, RadiusY = Height/2 }); Feature.Id = Id; Feature.Latitude = GeoCoordinate.Latitude; Feature.Longitude = GeoCoordinate.Longitude; Feature.Stroke = new SolidColorBrush(Colors.Black); Feature.StrokeThickness = 1; Feature.Width = Width; Feature.Height = Height; Feature.Fill = new SolidColorBrush(Color); Feature.ToolTip = Id; // The position on the map will be set within the PaintMap() method! this.Children.Add(Feature); return Feature; }
public Feature AddPath(String Id, Latitude Latitude, Longitude Longitude, Double Width, Double Height, Color Color) { var XY = GeoCalculations.WorldCoordinates_2_Screen(Latitude, Longitude, ZoomLevel); var PathGeometry1 = PathGeometry.Parse("M51,42c-5-4-11-7-19-7c-6,0-12,1-20,5l10-35c20-8,30-4,39,2l-10,35z"); var PathGeometry2 = PathGeometry.Parse("M106,13c-21,9-31,4-40-2l-10,35c9,6,20,11,40,2l10-35z"); var PathGeometry3 = PathGeometry.Parse("M39,83c-9-6-18-10-39-2l10-35c21-9,31-4,39,2l-10,35z"); var PathGeometry4 = PathGeometry.Parse("M55,52c9,6,18,10,39,2l-10,35c-21,8-30,3-39-3l10-34z"); var pathText = PathGeometry1.ToString(); var GD1 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0xE0, 0x60, 0x30)), null, PathGeometry1); var GD2 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0x70, 0xB0, 0x40)), null, PathGeometry2); var GD3 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0x40, 0x90, 0xc0)), null, PathGeometry3); var GD4 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0xF0, 0xD0, 0x50)), null, PathGeometry4); var DrawingGroup = new DrawingGroup(); DrawingGroup.Children.Add(GD1); DrawingGroup.Children.Add(GD2); DrawingGroup.Children.Add(GD3); DrawingGroup.Children.Add(GD4); var DrawingBrush = new DrawingBrush() { Drawing = DrawingGroup, TileMode = TileMode.None }; var Feature = new Feature(new RectangleGeometry() { Rect = DrawingGroup.Bounds }); Feature.Id = Id; Feature.Latitude = Latitude; Feature.Longitude = Longitude; Feature.Width = DrawingGroup.Bounds.Width; Feature.Height = DrawingGroup.Bounds.Height; Feature.Fill = DrawingBrush; Feature.ToolTip = Id; // The position on the map will be set within the PaintMap() method! this.Children.Add(Feature); return Feature; }