upload shapefile sample and query or select features

613
1
Jump to solution
02-19-2013 11:25 AM
VIKRANTKRISHNA
New Contributor III
I am replicating the upload shapefile sample in my application. Everything is showing up correctly on the map. Problem is that I am not able to query or select features from the uploaded layer, any query is giving an error as "query contains one or more unsupported parameters". My query is defined as

var query = new esri.tasks.Query();
query.where = "1 = 1";   // or   "FID = 1" or any other where clause.
query.outFields = ["*"];

uploadLayer.queryFeatures(query, function (featureSet) {
        console.log(featureSet);
    });

any ideas
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
The 'Add Shapefile' sample adds the shapefile to the map as a feature collection based feature layer. These layers do not support queries that need to be performed on the server - this includes queries with a where clause or non-extent based spatial queries. See the API Reference for more details:

http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#FeatureLayer/FeatureLayerConst2

View solution in original post

0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor
The 'Add Shapefile' sample adds the shapefile to the map as a feature collection based feature layer. These layers do not support queries that need to be performed on the server - this includes queries with a where clause or non-extent based spatial queries. See the API Reference for more details:

http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#FeatureLayer/FeatureLayerConst2
0 Kudos