I have successfully created a query for a feature layer. However, if I run the query while zoomed in, it only filters those graphics within view. When I zoom out, the areas that were not originally in view are not affected by the query.
Here is the site in question: Public Meeting Map
matthewiannowlinmatthewiannowlin
asked Sep 6, 2016 at 16:11
-
it would help if you could include the relevant code directly in your question, rather than making people open your app and hunt for it - you're more likely to get a good answer that wayStephen Lead– Stephen Lead2016年09月07日 01:57:35 +00:00Commented Sep 7, 2016 at 1:57
-
1Thanks for the comment. I definitely agree it wasn't the best way to present the question. I was posting this from mobile while stuck in a meeting. I edited the question to include a code pen link. Does that seem like the best way to do it? Rather than dumping all that script in here?matthewiannowlin– matthewiannowlin2016年09月07日 20:24:24 +00:00Commented Sep 7, 2016 at 20:24
1 Answer 1
In your code here:
featureLayer = new FeatureLayer(featureLayerURL,{
mode: FeatureLayer.MODE_ONDEMAND,
infoTemplate: popupTemplate,
outFields: ["*"],
maxRecordCount: null
});
try setting mode: FeatureLayer.MODE_ONDEMAND
to mode: FeatureLayer.MODE_SNAPSHOT
. More about FeatureLayer modes.
answered Sep 7, 2016 at 0:55
lang-js