using System; using ThinkGeo.MapSuite.Core; using ThinkGeo.MapSuite.GisEditor; using ThinkGeo.MapSuite.WpfDesktopEdition.Extension; using ThinkGeo.MapSuite.WpfDesktopEdition; public class Script { public static void ScriptMain(WpfMap map) { WmsRasterLayer wmslayer = new WmsRasterLayer(new Uri("http://wmssamples.thinkgeo.com/WmsServer.aspx")); wmslayer.UpperThreshold = double.MaxValue; wmslayer.LowerThreshold = 0; wmslayer.Open(); foreach (string layerName in wmslayer.GetServerLayerNames()) { wmslayer.ActiveLayerNames.Add(layerName); } wmslayer.SetInternalProj4ProjectionParameter(GisEditor.ActiveMap.DisplayProjectionParameters); wmslayer.Exceptions = "application/vnd.ogc.se_xml"; GisEditor.ActiveMap.AddLayersToActiveOverlay(wmslayer); GisEditor.UIManager.RefreshPlugins(); } }