${iServer2_BufferAnalystParam_Title}

${iServer2_BufferAnalystParam_Description}

        internal static string ToJson(BufferAnalystParam bufferAnalystParam)
        {
            if (bufferAnalystParam == null)
            {
                return null;
            }

            string json = "{";
            List<string> list = new List<string>();
            list.Add(string.Format("\"leftDistance\":{0}", bufferAnalystParam.LeftDistance));
            list.Add(string.Format("\"rightDistance\":{0}", bufferAnalystParam.RightDistance));
            list.Add(string.Format("\"semicircleLineSegment\":{0}", bufferAnalystParam.SemicircleLineSegment));

            list.Add(string.Format("\"bufferSideType\":\"{0}\"", ((int)bufferAnalystParam.BufferSideType).ToString()));
            list.Add(string.Format("\"bufferEndType\":\"{0}\"", ((int)bufferAnalystParam.BufferEndType)).ToString());

            json += string.Join(",", list.ToArray());
            json += "}";
            return json;
        }
        //设置缓冲区查询参数类
        private void LoadParam(SuperMap.Web.Core.Geometry geo)
        {
            List<QueryLayerParam> queryLayerParams = new List<QueryLayerParam>();
            if (QueriedComboBox.SelectedIndex != 3)
            {
                //在一个图层中查询,获取要查询的图层名
                QueryLayerParam queryLayerParam = new QueryLayerParam();
                queryLayerParam.Name = QueriedComboBox.SelectionBoxItem.ToString();

                //查询图层参数列表
                queryLayerParams = new List<QueryLayerParam>() { queryLayerParam };
            }
            else
            {
                //在三个图层中查询,获取要查询的图层名
                QueryLayerParam queryLayerParamLine = new QueryLayerParam();
                queryLayerParamLine.Name = SchoolLayerName;
                QueryLayerParam queryLayerParamPolygon = new QueryLayerParam();
                queryLayerParamPolygon.Name = RailLayerName;
                QueryLayerParam queryLayerParamPoint = new QueryLayerParam();
                queryLayerParamPoint.Name = ResidentialLayerName;

                //查询图层参数列表
                queryLayerParams = new List<QueryLayerParam>()
                    {   queryLayerParamPoint,
                        queryLayerParamLine,
                        queryLayerParamPolygon
                    };
            }

            //缓冲区参数类
            BufferAnalystParam param = new BufferAnalystParam
            {
                LeftDistance = 100,
                SemicircleLineSegment = 10,
            };

            //如果为缓冲区查询,则设置缓冲区查询参数
            if (BufferQuery.IsChecked == true)
            {
                BufferQueryParameters parameters = new BufferQueryParameters
                {
                    BufferParam = param,
                    Geometry = geo,
                    QueryMode = SpatialQueryMode.Intersect,
                    MapName = "Changchun",
                    QueryParam = new QueryParam { QueryLayerParams = queryLayerParams, ExpectCount = 0 }
                };
                BufferQueryService query = new BufferQueryService("http://localhost:7080/demo/");
                query.ProcessAsync(parameters);
                query.ProcessCompleted += new EventHandler<BufferQueryEventArgs>(query_ProcessCompleted);
                query.Failed += new EventHandler<ServiceFailedEventArgs>(query_Failed);
            }

            //如果为地物缓冲区查询,则设置地物缓冲区查询参数
            else
            {
                EntityBufferQueryParameters parameters = new EntityBufferQueryParameters
                {
                    BufferParam = param,
                    Geometry = geo,
                    QueryMode = SpatialQueryMode.Intersect,
                    MapName = "Changchun",
                    QueryParam = new QueryParam { QueryLayerParams = queryLayerParams, ExpectCount = 0 },
                    FromLayer = QueryComboBox.SelectionBoxItem.ToString()
                };
                EntityBufferQueryService query = new EntityBufferQueryService("http://localhost:7080/demo/");
                query.ProcessAsync(parameters);
                query.ProcessCompleted += new EventHandler<BufferQueryEventArgs>(query_ProcessCompleted);
                query.Failed += new EventHandler<ServiceFailedEventArgs>(query_Failed);
            }
        }