${IS6_BufferQueryParameters_Title}

${IS6_BufferQueryParameters_Description}

Inheritance: QueryParametersBase
        //设置缓冲区查询参数
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            BufferQueryParameters parameters = new BufferQueryParameters();

            //几何对象缓冲区查询
            if (BufferQuery.IsChecked == true)
            {
                BufferParam bufferParam = new BufferParam()
                {
                    Distance = 500,
                    FromCustomGeo = true,
                    Geometries = geometries,
                    Smoothness = 12,
                    QueryMode = SpatialQueryMode.AreaIntersect,
                    ReturnBufferResult = true
                };

                QueryLayer queriedLayer = new QueryLayer();
                queriedLayer.LayerName = QueriedComboBox.SelectionBoxItem.ToString();
                QueryParam queryParam = new QueryParam() { QueryLayers = new List<QueryLayer> { queriedLayer } };
                parameters = new BufferQueryParameters() { MapName = "changchun", QueryParam = queryParam, BufferParam = bufferParam };
            }

            //地物缓冲区查询
            else
            {
                QueryLayer queryLayer = new QueryLayer();
                queryLayer.LayerName = QueryComboBox.SelectionBoxItem.ToString();
                queryLayer.WhereClause = queryText.Text;

                BufferParam bufferParam = new BufferParam()
                {
                    FromLayer = queryLayer,
                    Distance = 500,
                    FromCustomGeo = false,
                    Smoothness = 12,
                    QueryMode = SpatialQueryMode.AreaIntersect,
                    ReturnBufferResult = true
                };

                QueryLayer queriedLayer = new QueryLayer();
                queriedLayer.LayerName = QueriedComboBox.SelectionBoxItem.ToString();
                QueryParam queryParam = new QueryParam() { QueryLayers = new List<QueryLayer> { queriedLayer } };
                parameters = new BufferQueryParameters() { MapName = "changchun", QueryParam = queryParam, BufferParam = bufferParam };
            }
            BufferQueryService bufferQueryService = new BufferQueryService("http://localhost/IS/AjaxDemo");
            bufferQueryService.ProcessAsync(parameters);
            bufferQueryService.Failed += new EventHandler<ServiceFailedEventArgs>(Service_Failed);
            bufferQueryService.ProcessCompleted += new EventHandler<BufferQueryEventArgs>(bufferQueryService_ProcessCompleted);

            resultLayer.MouseLeftButtonDown += new EventHandler<FeatureMouseButtonEventArgs>(resultLayer_MouseLeftButtonDown);
        }
 /// <summary>${IS6_BufferQueryService_method_ProcessAsync_D}</summary>
 /// <param name="parameters">${IS6_BufferQueryService_method_ProcessAsync_param_parameters}</param>
 /// <param name="state">${IS6_BufferQueryService_method_ProcessAsync_param_state}</param>
 public void ProcessAsync(BufferQueryParameters parameters, object state)
 {
     if (parameters == null)
     {
         //TODO:资源
         //throw new ArgumentNullException("BufferQueryParameters is Null");
         throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull);
     }
     if (string.IsNullOrEmpty(this.Url))
     {
         //TODO:资源
         //throw new InvalidOperationException("Url is not set");
         throw new InvalidOperationException(ExceptionStrings.InvalidUrl);
     }
     base.SubmitRequest(base.Url + "/path.ashx?", GetParameters(parameters),
         new EventHandler<RequestEventArgs>(request_Completed), state, false);
 }
        private Dictionary<string, string> GetParameters(BufferQueryParameters parameters)
        {
            Dictionary<string, string> dictionary = new Dictionary<string, string>();

            dictionary.Add("map", parameters.MapName);
            if (parameters != null && parameters.BufferParam != null)
            {
                if (parameters.BufferParam.FromCustomGeo)
                {
                    dictionary.Add("method", "BufferQueryByGeometries");
                    dictionary.Add("geometries", GetGeosStr(parameters.BufferParam.Geometries));
                }
                else
                {
                    dictionary.Add("method", "BufferQueryByLayer");
                    dictionary.Add("layer", QueryLayer.ToJson(parameters.BufferParam.FromLayer));
                }

            }
            dictionary.Add("bufferQueryParam", GetQueryStr(parameters.BufferParam, parameters.QueryParam));
            //dictionary.Add("bufferParam", BufferParam.ToJson(parameters.BufferParam));
            //dictionary.Add("queryParam", QueryParam.ToJson(parameters.QueryParam));
            dictionary.Add("trackingLayerIndex", "-1");
            dictionary.Add("userID", string.Format("\"{0}\"", Guid.NewGuid()));

            return dictionary;
        }
 /// <summary>${IS6_BufferQueryService_method_ProcessAsync_D}</summary>
 /// <overloads>${IS6_BufferQueryService_method_ProcessAsync_overloads_D}</overloads>
 /// <param name="parameters">${IS6_BufferQueryService_method_ProcessAsync_param_parameters}</param>
 public void ProcessAsync(BufferQueryParameters parameters)
 {
     ProcessAsync(parameters, null);
 }