private async void ExecuteExtentService() { try { string url = "http://support.supermap.com.cn:8090/iserver/services/Temperature/rest/domainComponents/Temperature/getTemperatureResult"; ExtendServerParameters param = new ExtendServerParameters() { Arg = "北京" }; ExtendServerService service = new ExtendServerService(url); ExtendServerResult e = await service.ProcessAsync(param); Feature feature = new Feature(); feature.Geometry = new GeoPoint(116, 40); feature.Style = MyMarkerStyle; Grid grid = new Grid(); grid.Background = new SolidColorBrush(Color.FromArgb(99, 00, 00, 00)); StackPanel sp = new StackPanel(); sp.Margin = new Thickness(5); sp.Children.Add(new TextBlock { Text = e.Extendresult, Foreground = new SolidColorBrush(Colors.Red), FontSize = 20 }); grid.Children.Add(sp); feature.ToolTip = grid; FeaturesLayer layer = new FeaturesLayer(); layer.Features.Add(feature); MyMap.Layers.Add(layer); } catch (Exception ex) { } }
public ServerExtend() { InitializeComponent(); string url = "http://localhost:8090/iserver/services/Temperature/rest/domainComponents/Temperature/getTemperatureResult"; ExtendServerParameters param = new ExtendServerParameters() { Arg = "北京" }; ExtendServerService service = new ExtendServerService(url); service.ProcessCompleted += new EventHandler<ExtendServerEventArgs>(service_ProcessCompleted); service.ProcessAsync(param); }
public void ProcessAsync(ExtendServerParameters parameters, object state) { if (parameters == null) { throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull); } if (string.IsNullOrEmpty(this.Url)) { throw new InvalidOperationException(ExceptionStrings.InvalidUrl); } base.Url += string.Format(".json?arg0={0}", parameters.Arg); base.SubmitRequest(base.Url, null, new EventHandler<RequestEventArgs>(request_Completed), state, false); }
//public async Task<ExtendServerResult> ProcessAsync(ExtendServerParameters parameters) //{ // return await ProcessAsync(parameters, null); //} public async Task<ExtendServerResult> ProcessAsync(ExtendServerParameters parameters) { if (parameters == null) { throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull); } if (string.IsNullOrEmpty(this.Url)) { throw new InvalidOperationException(ExceptionStrings.InvalidUrl); } base.Url += string.Format(".json?arg0={0}", parameters.Arg); var result = await base.SubmitRequest(base.Url, null, false); return ExtendServerResult.FromJson(result); }
public void ProcessAsync(ExtendServerParameters parameters) { ProcessAsync(parameters, null); }