${iServerJava6R_GetFeaturesBySQLParameters_Title}

${iServerJava6R_GetFeaturesBySQLParameters_Description}

Inheritance: GetFeaturesParametersBase
        public iServerJava6RRouteCalculateMeasure()
        {
            InitializeComponent();

            _routeLayer = MyMap.Layers["RouteLayer"] as FeaturesLayer;
            _elementsLayer = MyMap.Layers["MyElementsLayer"] as ElementsLayer;

            GetFeaturesBySQLParameters param = new GetFeaturesBySQLParameters
            {
                DatasetNames = new List<string> { "Changchun:RouteDT_road" },
                FilterParameter = new SuperMap.Web.iServerJava6R.FilterParameter
                {
                    AttributeFilter = "RouteID = 1690",
                }
            };
            GetFeaturesBySQLService ser = new GetFeaturesBySQLService(_dataUrl);
            ser.Failed += new EventHandler<ServiceFailedEventArgs>(ser_Failed);
            ser.ProcessCompleted += new EventHandler<GetFeaturesEventArgs>(ser_ProcessCompleted);
            ser.ProcessAsync(param);

            Pushpin pushpin1 = new Pushpin();
            pushpin1.IsEnabled = false;
            pushpin1.Location = new Point2D(4020.0045, -4377.0273);
            pushpin1.Content = "A";
            this._elementsLayer.AddChild(pushpin1);

            Pushpin pushpin2 = new Pushpin();
            pushpin2.IsEnabled = false;
            pushpin2.Location = new Point2D(6214.1838, -4209.9278);
            pushpin2.Content = "B";
            this._elementsLayer.AddChild(pushpin2);
            
        }
        /// <summary>${iServerJava6R_GetFeaturesBySQLService_method_ProcessAsync_D}</summary>
        /// <param name="parameters">${iServerJava6R_GetFeaturesBySQLService_method_ProcessAsync_param_Parameters}</param>
        /// <param name="state">${iServerJava6R_GetFeaturesBySQLService_method_ProcessAsync_param_state}</param>
        public void ProcessAsync(GetFeaturesBySQLParameters parameters, object state)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull);
            }
            if (string.IsNullOrEmpty(this.Url))
            {
                throw new InvalidOperationException(ExceptionStrings.InvalidUrl);
            }

            //base.Url += ".json?returnContent=true";
            base.Url += string.Format(System.Globalization.CultureInfo.InvariantCulture, ".json?returnContent=true&debug=true&fromIndex={0}&toIndex={1}", parameters.FromIndex, parameters.ToIndex);

            base.SubmitRequest(base.Url, GetParameters(parameters), new EventHandler<RequestEventArgs>(request_Completed), state, true);
        }
 private void GetFeaturesBySQLTest_Click(object sender , RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(MyTextBox.Text) || string.IsNullOrWhiteSpace(MyTextBox.Text))
     {
         MessageBox.Show("请输入查询条件");
         return;
     }
     GetFeaturesBySQLParameters param = new GetFeaturesBySQLParameters
     {
         DatasetNames = new List<string> { "World:Capitals" } ,
         FilterParameter = new SuperMap.Web.iServerJava6R.FilterParameter
         {
             AttributeFilter = MyTextBox.Text ,
         }
     };
     GetFeaturesBySQLService ser = new GetFeaturesBySQLService(url);
     ser.Failed += new EventHandler<SuperMap.Web.Service.ServiceFailedEventArgs>(ser_Failed);
     ser.ProcessCompleted += new EventHandler<GetFeaturesEventArgs>(ser_ProcessCompleted);
     ser.ProcessAsync(param);
 }
        void Chongqing_Loaded()
        {
            GetFeaturesBySQLParameters param = new GetFeaturesBySQLParameters
            {
                DatasetNames = new List<String>() { "A_重庆5万:roalkL" },
                FromIndex = 0,
                ToIndex = 20000
            };

            FilterParameter filterParameters = new FilterParameter();
            filterParameters.Name = "roalkL@A_重庆5万";
            filterParameters.AttributeFilter = "SMID=10";

            param.FilterParameter = filterParameters;

            GetFeaturesBySQLService getFeaturesByGeometryServiceInSelectEditTool = new GetFeaturesBySQLService("http://localhost:8090/iserver/services/data-world/rest/data/featureResults");
            getFeaturesByGeometryServiceInSelectEditTool.ProcessAsync(param);
            getFeaturesByGeometryServiceInSelectEditTool.ProcessCompleted += new EventHandler<GetFeaturesEventArgs>(getFeaturesByGeometryServiceInSelectEditTool_ProcessCompleted);
            getFeaturesByGeometryServiceInSelectEditTool.Failed += new EventHandler<ServiceFailedEventArgs>(query_Failed);
        }
        private Dictionary<string, string> GetParameters(GetFeaturesBySQLParameters parameters)
        {
            Dictionary<string, string> dictionary = new Dictionary<string, string>();

            dictionary.Add("getFeatureMode", "\"SQL\"");

            if (parameters.DatasetNames != null && parameters.DatasetNames.Count > 0)
            {
                string jsonDatasetNames = "[";
                List<string> list = new List<string>();
                for (int i = 0; i < parameters.DatasetNames.Count; i++)
                {
                    list.Add(string.Format("\"{0}\"", parameters.DatasetNames[i]));
                }
                jsonDatasetNames += string.Join(",", list.ToArray());
                jsonDatasetNames += "]";

                dictionary.Add("datasetNames", jsonDatasetNames);
            }
            if (parameters.MaxFeatures > 0)
            {
                dictionary.Add("maxFeatures", parameters.MaxFeatures.ToString(System.Globalization.CultureInfo.InvariantCulture));
            }
            dictionary.Add("queryParameter", FilterParameter.ToJson(parameters.FilterParameter));

            return dictionary;
        }
 /// <summary>${iServerJava6R_GetFeaturesBySQLService_method_ProcessAsync_D}</summary>
 /// <overloads>${iServerJava6R_GetFeaturesBySQLService_method_ProcessAsync_overloads_D}</overloads>
 public void ProcessAsync(GetFeaturesBySQLParameters parameters)
 {
     ProcessAsync(parameters, null);
 }