public ProcessAsync ( |
||
parameters | ${iServer2_GetEntityService_method_ProcessAsync_param_parameters} | |
return | void |
//查询成功高亮显示选中地物,并显示相关属性信息 private void query_ProcessCompleted(object sender, QueryEventArgs e) { //点击处没有地物的情况 if (e.ResultSet == null) { MessageBox.Show("查询结果为空!"); dgVegetable.Visibility = Visibility.Collapsed; return; } //点击处存在地物时,用蓝色边显示该地物 PredefinedFillStyle selectStyle = new PredefinedFillStyle(); selectStyle.Stroke = new SolidColorBrush(Colors.Blue); FeatureCollection fc = e.ResultSet.RecordSets[0].ToFeatureSet(); Feature f = new Feature { Geometry = fc[0].Geometry, Style = selectStyle }; drawLayer.Features.Add(f); //记录地物ID号,为设置GetEntityParameters做准备 entityID = e.ResultSet.RecordSets[0].Records[0].Shape.Id; GetEntityParameters parameters = new GetEntityParameters { ID = entityID, MapName = "Changchun", LayerName = "Vegetable@changchun" }; GetEntityService getEntityService = new GetEntityService("http://localhost:7080/demo"); getEntityService.ProcessAsync(parameters); getEntityService.ProcessCompleted += new EventHandler<GetEntityEventArgs>(getEntityService_ProcessCompleted); }