I have a feature layer with many features, and when I load on map viewer (Portal for Arcgis), I receive a message that 'Layer did not draw completely'. This is ok, because this layer don't have any visible range configured and have many features.
But, when I try to use this feature layer on ArcGIS API for Javascript, the layer don't draw completely too, but I don't know how detect if this layer was draw completely or not (to show a message for the user).
I already tried the 'update-end' event of feature layer, but this event don't show any error, even when the layer was not draw completely.
Code:
var featureLayer = new FeatureLayer("http://server/acgis/rest/services/ServiceTest/FeatureServer/0", { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); featureLayer.on("update-end", function(e) { console.log(e); }); map.addLayer(featureLayer);
Solved! Go to Solution.
I founded (I think):
This information was not on 'error' property, but in 'info' property!
featureLayer.on("update-end", function(e) { if (e != undefined && e.info != undefined && e.info.queryLimitExceeded) { console.log("Layer did not draw completely"); } });
In FeatureLayer | API Reference | ArcGIS API for JavaScript, on update-end event, the Event Object has a 'error' property and a 'info' property, and looking at documentation, the info property has the following information:
Optional object that may have a boolean
queryLimitExceeded
property.queryLimitExceeded
will be true if the feature layer could not draw all features due to amaxRecordCount
limitation on the query operation. As of v2.8
I founded (I think):
This information was not on 'error' property, but in 'info' property!
featureLayer.on("update-end", function(e) { if (e != undefined && e.info != undefined && e.info.queryLimitExceeded) { console.log("Layer did not draw completely"); } });
In FeatureLayer | API Reference | ArcGIS API for JavaScript, on update-end event, the Event Object has a 'error' property and a 'info' property, and looking at documentation, the info property has the following information:
Optional object that may have a boolean
queryLimitExceeded
property.queryLimitExceeded
will be true if the feature layer could not draw all features due to amaxRecordCount
limitation on the query operation. As of v2.8