public override void Execute(object parameter) { IMapServerRESTLayer pRestLayer = new MapServerRESTLayerClass(); pRestLayer.Connect("http://myServer:6080/arcgis/rest/services/WaterMap2015/MapServer"); this.MapControl.AddLayer(pRestLayer as ILayer); }
/// <summary> /// 获取REST的地图服务图层 /// </summary> /// <param name="serviceUrl">服务地址,例:http://192.168.1.102:7485/tset/rest/services/GDZL?token=jeGFSsDzTX3U3Fx4phYDhl2lGw3Veip4DC3k43QxMWHfzCRmvbh2eA5CQ-LQcalC </param> /// <returns></returns> public ILayer GetRESTLayer(string serviceUrl) { IMapServerRESTLayer restLayer = new MapServerRESTLayerClass(); restLayer.Connect(serviceUrl); return(restLayer as ILayer); }