Can I have the filter widget zoom to features ? Thanks.
Solved! Go to Solution.
Oh that 218 (points) was for the point feature polygon (my real app will have to use it) . The one I sent you returns only 1 polygon at a time.
OK,
But the url you proved was altered so I can not test using your data and as I mentioned with my polygon data it works fine.
My server is not accessible from outside. I use portal not Arcgis online. I notice there're some differences from the two. Thanks.
Helen,
My last reply should fix the issue.
Helen,
OK so I found the difference between your data and mine that I was testing. Mine was using wkid 102100 like the maps wkid.
So make this change (line 6):
//Add RJS Now zoom to the results
var qt = QueryTask(layerInfo.getUrl());
var q = Query();
q.returnGeometry = true;
q.where = layerFilterExpr;
q.outSpatialReference = this.map.spatialReference;
qt.execute(q, lang.hitch(this, function(fs){
this.map.setExtent(graphicsUtils.graphicsExtent(fs.features), true);
}));
//End RJS
That's what it is. Thank you so much!
The code changed slightly and the query is Null in the queryTask, causing it to fail, so then map.setExtent has no feature. Any ideas?
David did you see this reply:
https://community.esri.com/thread/184442-filter-widget-zoom-to-features#comment-725003
Melissa,
You are going to have a REALLY hard time adding this code to a minified version of the widget.js like you are attempting to do.