I'm trying to run a queryExtent() on a FeatureLayer that has a Definition Expression applied, but it seems to ignore the Definition Expression when query.where is given. I'm trying to zoom to the selected states, but not AK/HI because there are inset maps for those.
var mydefinitionExpression = makeStateQuery();
const layer = new FeatureLayer({
url: url,
definitionExpression: mydefinitionExpression,
});
layer.when(function(){
var query = layer.createQuery();
query.where = "(StateFIPSN <> 02 AND StateFIPSN <> 15)";
return layer.queryExtent(query);
})
.then(function(response){
view.goTo({
target:response.extent,
duration:500
});
});
It seems like I should be able to use both where and defEx, but the extent returned indicates that it's one or the other. Am I missing something?