using System.IO; using System.Windows.Browser; using System.Windows; using System.Collections.Generic; using System; using System.Windows.Input; using System.Windows.Media; using ThinkGeo.MapSuite.SilverlightEdition; using ThinkGeo.MapSuite.SilverlightCore; using System.Collections.ObjectModel; using System.Windows.Media.Imaging; using System.Windows.Controls; using Telerik.Windows.Controls; using Beetle.Silverlight.Controls; using System.Windows.Media.Animation; namespace MapPerformance { public partial class MainPage : UserControl { public MainPage() { // Required to initialize variables InitializeComponent(); this.Loaded +=new RoutedEventHandler(MainPage_Loaded); } void MainPage_Loaded(object sender, RoutedEventArgs e) { Map1.MapTools.MouseCoordinate.MouseCoordinateType = MouseCoordinateType.LatitudeLongitude; Map1.MapTools.PanZoomBar.IsEnabled = true; Map1.MapUnit = GeographyUnit.Meter; Map1.MapTools.MouseCoordinate.IsEnabled = true; Map1.Background = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255)); ServerLayerOverlay overlay = new ServerLayerOverlay("CanaveralMap1Server", "SilverlightMapConnector1"); Map1.Overlays.Add("CanaveralMap1Server", overlay); ServerLayerOverlay overlay1 = new ServerLayerOverlay("CanaveralMap2Server", "SilverlightMapConnector1"); Map1.Overlays.Add("CanaveralMap2Server", overlay1); ServerLayerOverlay overlay2 = new ServerLayerOverlay("CanaveralMap3Server", "SilverlightMapConnector1"); Map1.Overlays.Add("CanaveralMap3Server", overlay2); Map1.CurrentExtent = new RectangleShape(533181.490451491, 3144268.68096696, 544626.363014241, 3138546.24468558); Map1.Refresh(); /* Please change font size of txtStyle object to 80 and see the chages on the map. The size of the text won't be increased. * Please change the rotation angle of the txtStyle object (txtStyle.RotationAngle = 40;). * The feature text will be * */ TextStyle txtStyle = new TextStyle("Name",new GeoFont("Arial",20),new GeoSolidBrush(new GeoColor(255,0,0))); txtStyle.SuppressPartialLabels = false; //txtStyle.RotationAngle = 40; InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer(); inMemoryFeatureLayer.Columns.Add(new FeatureSourceColumn("State")); inMemoryFeatureLayer.Columns.Add(new FeatureSourceColumn("Name")); ValueStyle vs = new ValueStyle(); vs.ColumnName = "state"; vs.ValueItems.Add(new ValueItem("ok", new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(new GeoColor(255, 0, 0)), 20))); vs.ValueItems.Add(new ValueItem("fail", new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(new GeoColor(0, 255, 0)), 20))); inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(vs); inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(txtStyle); inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; double x = 537530.542025336; double y = 3142780.8475; PointShape Radarpoint = new PointShape(x, y); Feature f = new Feature(new PointShape(x, y)); f.ColumnValues["State"] = "fail"; f.ColumnValues["Name"] = "Feature text"; inMemoryFeatureLayer.InternalFeatures.Add(f); LayerOverlay layerFeatureOverlay = new LayerOverlay(); layerFeatureOverlay.Layers.Add("radar", inMemoryFeatureLayer); Map1.Overlays.Add("AustinOverlay", layerFeatureOverlay); } } }