i use the addshapefile widget to add a widget to the map and then I tried to run a query to capture features of the shapefile that intercept the buffer around a line segment. However I get the message:
"FeatureLayer::selectFeatures - query contains one or more unsupported parameters".
Can the feature layer from the shapefile be used for query?
Thank you.
myfeaturelayer is the feature layer from the shapefile created from:
arrayUtils.forEach(featureCollection.layers, lang.hitch(this, function (layer) { var infoTemplate = new InfoTemplate("Details", "${*}"); var featureLayer = new FeatureLayer(layer, { infoTemplate: infoTemplate });
Buffer Widget:
The resultEvent is the geometry of a line
var myquery = new Query(); myquery.geometry = resultEvent; myquery.returnGeometry = true; myquery.outFields = ["*"]; myquery.outSpatialReference = this.map.spatialReference; myquery.spatialRelationship = Query.SPATIAL_REL_INTERSECTS; this.myfeatureLayer.selectFeatures(myquery,FeatureLayer.SELECTION_NEW);
Solved! Go to Solution.
Lefteris,
When you create a FeatureLayer from a feature collection you are limited to what functionality it has as noted in the FeatureLayer Help:
Creates a new instance of a feature layer using a FeatureCollection object. The feature layer, when initialized with a feature collection object has the following behavior:
Lefteris,
When you create a FeatureLayer from a feature collection you are limited to what functionality it has as noted in the FeatureLayer Help:
Creates a new instance of a feature layer using a FeatureCollection object. The feature layer, when initialized with a feature collection object has the following behavior:
Thank you Robert. Got one more question. the text in bold states "queries with a where clause or non-extent based spatial queries".
The query that I am using has no where clause. If I replace the geometry of the query with an extent to create an extent based query, will that work?
var queryExtent = new esri.geometry.Extent(x-tol,y-tol,x+tol,y+tol,evt.mapPoint.spatialReference);
myquery.geometry = queryExtent;
Lefteris,
Based on the use notes, that should work.
I just checked it. It does work. Thank you.