using System.Windows; using System.Windows.Controls; using ThinkGeo.MapSuite.Core; using ThinkGeo.MapSuite.WpfDesktopEdition; using System.Collections.ObjectModel; using System; using System.Net; namespace CSHowDoISamples { /// /// Interaction logic for DisplayASimpleMap.xaml /// public partial class DisplayASimpleMap : UserControl { public DisplayASimpleMap() { InitializeComponent(); } private void WpfMap_Loaded(object sender, RoutedEventArgs e) { Map1.MapUnit = GeographyUnit.DecimalDegree; Map1.CurrentExtent = new RectangleShape(-155.733, 95.60, 104.42, -81.9); Vertex llPoint = new Vertex(-76.615411, 39.29167); Vertex urPoint = new Vertex(-76.610031, 39.295277); Map1.CurrentExtent = new RectangleShape(llPoint.X, urPoint.Y, urPoint.X, llPoint.Y); TiledWmsLayer tiledWmsLayer = new TiledWmsLayer(new System.Uri("http://localhost/WorldMapKitServer/WmsServer.axd")); tiledWmsLayer.ActiveLayerNames.Add("WorldMapKitLayer"); tiledWmsLayer.ActiveStyleNames.Add("WorldMapKitDefaultStyle"); tiledWmsLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException; tiledWmsLayer.TimeoutInSeconds = 300; LayerOverlay overlay = new LayerOverlay(); overlay.Layers.Add(tiledWmsLayer); overlay.TileType = TileType.SingleTile; Map1.Overlays.Add(overlay); //TiledWmsOverlay overlay = new TiledWmsOverlay(new Collection() { new Uri("http://localhost/WorldMapKitServer/WmsServer.axd") }); //overlay.Parameters.Add("LAYERS", "WorldMapKitLayer"); //overlay.Parameters.Add("STYLES", "WorldMapKitDefaultStyle"); //overlay.TileType = TileType.SingleTile; //Map1.Overlays.Add(overlay); } } }