using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using ThinkGeo.MapSuite.WpfDesktopEdition; using ThinkGeo.MapSuite.Core; using System.Collections.ObjectModel; namespace SimpleEllipse { public class pointst { public double lat {get;set;} public double lon { get; set; } public string tagtext { get; set; } } public partial class MainWindow : Window { InMemoryFeatureLayer testlayer = new InMemoryFeatureLayer(); public MainWindow() { InitializeComponent(); Draw(); } private void Draw() { WorldMapKitWmsWpfOverlay worldMapKitOverlay = null; worldMapKitOverlay = new WorldMapKitWmsWpfOverlay(); worldMapKitOverlay.Projection = WorldMapKitProjection.DecimalDegrees; Map.Overlays.Add(worldMapKitOverlay); EllipseShape circleShape = null; GeoLinearGradientBrush geoBrush = null; GeoColor stColor = GeoColor.FromArgb(100, GeoColor.StandardColors.Green); GeoColor endColor = GeoColor.FromArgb(10, GeoColor.StandardColors.LightCoral); geoBrush = new GeoLinearGradientBrush(stColor, endColor, GeoLinearGradientDirection.UpperLeftToLowerRight); geoBrush.WrapMode = GeoWrapMode.TileFlipXY; testlayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.Advanced.FillCustomBrush = geoBrush; testlayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.CreateMaskTextStyle("Label", new GeoFont("Arial", 10), new GeoSolidBrush(GeoColor.SimpleColors.Black), new AreaStyle(new GeoPen(GeoColor.StandardColors.Black), new GeoSolidBrush(GeoColor.StandardColors.LightGoldenrodYellow)), 10, 0); testlayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColor.StandardColors.DarkBlue; testlayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen = new GeoPen(GeoColor.FromArgb(200, GeoColor.StandardColors.Green), 1); testlayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolPen = new GeoPen(GeoColor.FromArgb(255, GeoColor.StandardColors.Green), 8); testlayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; testlayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; testlayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Font = new GeoFont("Arial", 8, DrawingFontStyles.Bold); testlayer.Open(); testlayer.Columns.Add(new FeatureSourceColumn("Label")); testlayer.Close(); double centerX = -75.16058350000; double centerY = 39.91750340000; pointst pt = new pointst(); pt.lat = centerY; pt.lon = centerX; pt.tagtext = "ONE"; double dRadius = 2.5; PointShape ptCenter = new PointShape(centerX, centerY); LayerOverlay dynamicOverlay = new LayerOverlay(); circleShape = new EllipseShape(ptCenter, dRadius,GeographyUnit.DecimalDegree,DistanceUnit.Mile); Feature featShape = new Feature(circleShape); featShape.ColumnValues.Add("Label", "Oval"); featShape.Tag = pt; testlayer.InternalFeatures.Add("1", featShape); circleShape.Id = "Oval"; circleShape.Tag = "Oval"; dynamicOverlay.Layers.Add(testlayer); Map.Overlays.Add(dynamicOverlay); } public static RectangleShape GetUSExtent() { RectangleShape usExtent = new RectangleShape(-128.0, 50.0, -60.0, 22.0); return usExtent; } } }