//合并选中地物 private void UnionEntity_Click(object sender, RoutedEventArgs e) { SpatialOperateParameters spatialOper = new SpatialOperateParameters { SpatialOperationType = SpatialOperationType.Union, MapName = "Changchun" }; //所选地物只有一个时 if (unionGeometry.Count < 2) { MessageBox.Show("请选择两个地物进行合并!"); } //选中多个地物时,只将最后两个被选择地物合并 else { spatialOper.SourceGeometry = unionGeometry[unionGeometry.Count - 2]; spatialOper.OperatorGeometry = unionGeometry[unionGeometry.Count - 1]; } //与服务器交互合并地物 SpatialOperateService spatialService = new SpatialOperateService("http://localhost:7080/demo"); spatialService.ProcessAsync(spatialOper); spatialService.Failed += (s, args) => { MessageBox.Show(args.Error.ToString()); }; spatialService.ProcessCompleted += new EventHandler<SpatialOperateEventArgs>(spatialService_ProcessCompleted); }
private void union_Click(object sender, RoutedEventArgs e) { SpatialOperateParameters sop = new SpatialOperateParameters { SourceGeometry = sgVegetable, OperatorGeometry = sgResidentialArea, SpatialOperationType = SpatialOperationType.Union, MapName = "Changchun" }; SpatialOperateService sos = new SpatialOperateService("http://localhost:7080/demo"); sos.ProcessAsync(sop); sos.Failed += (s, args) => { MessageBox.Show(args.Error.ToString()); }; sos.ProcessCompleted += new EventHandler<SpatialOperateEventArgs>(sos_ProcessCompleted); }