AnsweredAssumed Answered

custom featurelayer pagination load

Question asked by yanasdf789 on Aug 12, 2016
Latest reply on Aug 12, 2016 by fcbassongis

I find featurelayer with arcgis for js 4.0  can load large data form server with "pagination",  like this "Axis politics ".

so  I  try to Realization it  without the pagination,my code i

var queryTask = new QueryTask({
    url: "http://*******/arcgis/rest/services/Test/MapServer/1"
});
var time = 0;

function querydata() {

    for (var i = 0; i < 8; i++) {

        var query = new Query();
        query.returnGeometry = true;
        //query.outFields = ["OBJECTID", "RELHEI", "name"];
        query.outFields = ["*"];
        var start = 0 + i * 1000
        var end = start + 1000
        query.where = "OBJECTID > " + start + " AND OBJECTID < " + end;

        queryTask.execute(query)
            .then(function (results) {
                time++;
                var l = results.features;

                if (time == 8) {

                    myMap.add(querylayer);
                }
                collection.addMany(results.features);
                querylayer.source = collection;

            })
            .otherwise(function (error) {
                console.log(error);
            })

    }

}

I load the 8000 polygon. I find it slow, the featurelayer render all the geometry once ,it  not render 8 times.how to realize render the featurelayer one by one?????

Outcomes