AnsweredAssumed Answered

Why does featureset have > 1000 feats when query-features-complete fires?

Question asked by kirkktx on Mar 10, 2016

I'm developing a WAB widget and testing it in a time-aware map.  The OOTB timeslider widget is also being used.

 

I add a time-aware featurelayer to the map with ONDEMAND mode.

The maxFeatures is 1000.  I would expect when query-limit-exceeded fires, that the subsequent firing of query-features-complete would show exactly 1000 features in the set.  This is not the case.  Here's the log as I increment the time slider, the first few times the features update as expected, until query-limit-exceeded fires:

Sometime query-limit-exceeded will fire, even when the featset has fewer than 1000 features.  I suspect I'm misunderstanding how time-awareness works.

 

var fLayer = FeatureLayer(url, {

  mode: FeatureLayer.MODE_ONDEMAND,

  outFields: ["mag"]

});

var exceeded = false;

fLayer.on("query-limit-exceeded",function(){

    console.log("query-limit-exceeded");

    exceeded = true;

});

fLayer.on("update-start",function(){               

    console.log("update-start")

    exceeded = false;

});

fLayer.on("query-features-complete",function(featset){

    var cnt = featset.featureSet.features.length;

    if(exceeded){

        console.log("only showing first " + fLayer.maxRecordCount + " features, " + cnt);          

    }else{

        console.log("retrieved ", cnt);                   

    }

});

Outcomes