server: using System.Collections.ObjectModel; using ThinkGeo.MapSuite.Core; using ThinkGeo.MapSuite.WmsServerEdition; namespace WmsPlugins { public class DisplayASimpleMapWmsLayerPlugin : WmsLayerPlugin { protected override MapConfiguration GetMapConfigurationCore(string style, string crs) { ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"C:\Users\zhangxin.APTHINKGEO\Desktop\DarWard\DarWard\Dar_Ward.shp"); worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1; worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; MapConfiguration mapConfiguration = new MapConfiguration(); mapConfiguration.Layers.Add("WorldLayer", worldLayer); return mapConfiguration; } protected override string GetNameCore() { return "Display A Simple Map"; } protected override Collection GetProjectionsCore() { return new Collection { "EPSG:32737" }; } protected override RectangleShape GetBoundingBoxCore(string crs) { return new RectangleShape(504441.13594295, 9274556.264485, 530810.831252072, 9243167.72723482); } } } Client: winformsMap1.MapUnit = GeographyUnit.Meter; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); TiledWmsLayer tiledWmsLayer = new TiledWmsLayer(new Uri("http://localhost:59387/WmsHandler.axd")); tiledWmsLayer.ActiveLayerNames.Add("Display A Simple Map"); tiledWmsLayer.ActiveStyleNames.Add("DEFAULT"); tiledWmsLayer.Crs = "EPSG:32737"; LayerOverlay staticOverlay = new LayerOverlay(); staticOverlay.Layers.Add("SimpleWmsLayerPlugin", tiledWmsLayer); winformsMap1.Overlays.Add(staticOverlay); winformsMap1.CurrentExtent = new RectangleShape(504441.13594295, 9274556.264485, 530810.831252072, 9243167.72723482); winformsMap1.Refresh();