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); }