${IS6_QueryServiceEventArgs_Title}
${IS6_QueryServiceEventArgs_Description}
private void query_ProcessCompleted(object sender, QueryServiceEventArgs e) { if (e.ResultSet == null) { MessageBox.Show("没结果!"); return; } FeaturesLayer featuresLayer = MyMap.Layers["MyFeaturesLayer"] as FeaturesLayer; foreach (RecordSet item in e.ResultSet.RecordSets) { foreach (Feature feature in item.ToFeatureSet()) { featuresLayer.Features.Add(feature); } } }
//处理服务器返回结果 private void queryBySqlService_ProcessCompleted(object sender, QueryServiceEventArgs e) { if (e.ResultSet == null || e.ResultSet.RecordSets == null || e.ResultSet.RecordSets.Count < 0) { MessageBox.Show("查询结果为空!"); return; } else { MyDataGrid.Visibility = Visibility.Visible; //将指定查询图层的查询结果加载到矢量图层中 foreach (RecordSet item in e.ResultSet.RecordSets) { featuresLayer.AddFeatureSet(item.ToFeatureSet()); } //将查询到的地物赋予用户自定义的样式 foreach (Feature item in featuresLayer.Features) { if (item.Geometry is GeoLine) { item.Style = LineSelectStyle; } else if (item.Geometry is GeoRegion) { item.Style = SelectStyle; } else { item.Style = new PredefinedMarkerStyle() { Color = new SolidColorBrush(Colors.Blue), Size = 20, Symbol = PredefinedMarkerStyle.MarkerSymbol.Diamond }; } } } }
private void request_Completed(object sender, RequestEventArgs e) { JsonObject jsonObject = (JsonObject)JsonObject.Parse(e.Result); ResultSet result = ResultSet.FromJson(jsonObject); LastResult = result; QueryServiceEventArgs args = new QueryServiceEventArgs(result, e.Result, e.UserState); OnProcessCompleted(args); }
private void OnProcessCompleted(QueryServiceEventArgs args) { if (ProcessCompleted != null) { Application.Current.RootVisual.Dispatcher.BeginInvoke( ProcessCompleted, new object[] { this, args }); } }
private void queryService_ProcessCompleted(object sender, QueryServiceEventArgs e) { if (e.ResultSet != null && e.ResultSet.RecordSets != null && e.ResultSet.CurrentCount != 0 && e.ResultSet.RecordSets != null) { centers.Add(new ServerCenter { ID = Convert.ToInt32(e.ResultSet.RecordSets[0].Records[0].FieldValues[2]), CandidateType = CenterCandidateType.Mobile, MaxImpedance = 1000, Resource = 8000 }); } }