${iServerJava6R_Query_QueryServiceEventArgs_Title}
${iServerJava6R_Query_QueryServiceEventArgs_Description}
//将查询结果加入HeatMapLayer图层中 private void service_ProcessCompleted(object sender, QueryEventArgs e) { if (e.Result == null) { return; } hpCollection = new HeatPointCollection(); hpCollectionGeoRadius = new HeatPointCollection(); if (e.Result.Recordsets != null) { foreach (Recordset item in e.Result.Recordsets) { foreach (var item1 in item.Features) { HeatPoint heatPoint = new HeatPoint() { X = item1.Geometry.Bounds.Center.X, Y = item1.Geometry.Bounds.Center.Y, Value = 10, }; HeatPoint heatPointGeoRadius = new HeatPoint() { X = item1.Geometry.Bounds.Center.X, Y = item1.Geometry.Bounds.Center.Y, Value = 10, GeoRadius = 3 }; hpCollectionGeoRadius.Add(heatPointGeoRadius); hpCollection.Add(heatPoint); } } } layer.HeatPoints = hpCollection; layer.Radius = (int)sliderRadius.Value; layer.Intensity = sliderIntensity.Value; }
private void sqlService_ProcessCompleted(object sender, QueryEventArgs e) { int zMin = Convert.ToInt32(zMinValue.Text); int zMax = Convert.ToInt32(zMaxValue.Text); FeatureCollection fc = e.Result.Recordsets[0].Features; for (int i = 0; i < fc.Count; i++) { GeoPoint gp = fc[i].Geometry as GeoPoint; var z = random.Next(zMin, zMax); Point2D point = new Point2D() { X = gp.X, Y = gp.Y, Tag = z }; inputPoints.Add(point); } InterpolationIDWAnalystParameters idwParams = new InterpolationIDWAnalystParameters() { Bounds = new Rectangle2D(-2640403.6321084504, 1873792.1034850003, 3247669.390292245, 5921501.395578556), OutputDataset = "idwcretepoints", OutputDataSource = "Interpolation", SearchMode=SearchMode.KDTREE_FIXED_RADIUS, InterpolationAnalystType=InterpolationAnalystType.GEOMETRY, InputPoints = inputPoints }; InterpolationAnalystService service = new InterpolationAnalystService(url); service.ProcessCompleted += new EventHandler<InterpolateAnalystArgs>(processCompleted); service.Failed += new EventHandler<SuperMap.Web.Service.ServiceFailedEventArgs>(excuteErrors); service.ProcessAsync(idwParams); }
private void service_ProcessCompleted(object sender , QueryEventArgs e) { if (e.Result == null) { MessageBox.Show("没有查询到结果!"); return; } int i = 0; foreach (Recordset item in e.Result.Recordsets) { foreach (Feature feature in item.Features) { feature.ToolTip = new TextBlock { Text = i++.ToString(System.Globalization.CultureInfo.InvariantCulture) }; uniqueRenderLayer.Features.Add(feature); } } }
private void service1_ProcessCompleted(object sender , QueryEventArgs e) { if (e.Result == null) { MessageBox.Show("没有查询到结果!"); return; } foreach (Recordset item in e.Result.Recordsets) { foreach (Feature feature in item.Features) { uniformRendererLayer.Features.Add(feature); } } uniformRendererLayer.Renderer = new UniformRenderer { FillStyle = new FillStyle { Fill = new SolidColorBrush(Color.FromArgb(0xff , 0xe5 , 0xe5 , 0x45)) , Stroke = new SolidColorBrush(Color.FromArgb(0xff , 0x7f , 0x80 , 0x13)) } }; }
private void service_ProcessCompleted(object sender, QueryEventArgs e) { if (e.Result == null) { MessageBox.Show("查询结果为空!"); return; } //flayer.Features.Clear(); foreach (Recordset recordset in e.Result.Recordsets) { flayer.AddFeatureSet(recordset.Features); } foreach (Feature item in flayer.Features) { item.Style = SelectStyle; } foreach (Feature item in flayer.Features) { item.Selected = true; } }
private void service_ProcessCompleted(object sender, QueryEventArgs e) { //无查询结果的情况 if (e.Result == null) { MessageBox.Show("查询结果为空!"); return; } //如果当前矢量图层中存在上一次的查询地物,则清除 if (flayer.Features.Count > 0) { flayer.Features.Clear(); } //隐藏高亮图层 highlayer.IsVisible = false; //当 ReturnContent = false 且有查询结果时,返回结果中的 ResourceInfo 不为空 //当 ReturnContent = true 且有查询结果时,返回结果中的 Recordsets 不为空,ResourceInfo 为空 if (e.Result.ResourceInfo != null) { highlayer.IsVisible = true; //获取高亮图片在服务器上存储的资源 ID 号 highlayer.QueryResultID = e.Result.ResourceInfo.NewResourceID; //设置服务端高亮图层的样式 highlayer.Style = new ServerStyle() { FillForeColor = new Color { R = 0, G = 160, B = 0 }, LineWidth = 0, FillOpaqueRate = 90 }; //该判断控制只加载一个高亮图层 if (!isAdded) { this.MyMap.Layers.Add(highlayer); isAdded = true; } } else { //显示 FeatureDataGrid 控件 MyDataGrid.Visibility = Visibility.Visible; //将查询结果记录集中的数据转换为矢量要素并在矢量图层中显示 foreach (Recordset recordset in e.Result.Recordsets) { foreach (Feature f in recordset.Features) { flayer.Features.Add(f); } } //将查询到的地物赋予 XMAL 中自定义样式 foreach (Feature item in flayer.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); QueryResult result = QueryResult.FromJson(jsonObject); LastResult = result; QueryEventArgs args = new QueryEventArgs(result, e.Result, e.UserState); OnProcessCompleted(args); }
private void OnProcessCompleted(QueryEventArgs args) { if (ProcessCompleted != null) { //Application.Current.RootVisual.Dispatcher.BeginInvoke(ProcessCompleted, new object[] { this, args }); this.ProcessCompleted(this, args); } }
private void service_ProcessCompleted(object sender, QueryEventArgs e) { if (e.Result == null) { MessageBox.Show("查询结果为空!"); return; } if (e.Result.ResourceInfo != null) { highlayer.QueryResultID = e.Result.ResourceInfo.NewResourceID; if (!isAdded) { this.MyMap.Layers.Add(highlayer); highlayer.Style = new ServerStyle { FillForeColor = Colors.Red, FillBackColor = Colors.Transparent }; isAdded = true; } } else { foreach (Recordset recordset in e.Result.Recordsets) { foreach (Feature f in recordset.Features) { f.Style = new FillStyle { Fill = new SolidColorBrush(new Color { A = 10, R = 0, G = 100, B = 0 }), Stroke = new SolidColorBrush(Colors.Blue), StrokeThickness = 1 }; flayer.Features.Add(f); } } } }