JSAPI4.6 - watching a layers 'updating' property bugged?

343
2
02-22-2018 05:35 AM
yves_Ramseier
New Contributor

Hello

I'm trying to watch a feature layer views `updating` property in order to know whether it is finished loading a layer or not:

var featureLayer = new FeatureLayer({
   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});

map.add(featureLayer);

view.whenLayerView(featureLayer).then(function(lyrView){
   watchUtils.watch(lyrView, 'updating', function(val) {
      console.log(val);
   });
});

https://jsfiddle.net/50kxg4o6/3/ 

However, it seems to be bugged, as it shows the values `true` or `undefined`, but never `false`. 

Am I doing something wrong?

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Yves,

   You are correct. In version 4.4 it returned false/true as the documentation states, but in 4.5 and 4.6 it returns undefined/true.

Kelly HutchinsBjorn Svensson

BjornSvensson
Esri Regular Contributor

That seems to be a bug in version 4.5 and 4.6. It shouldn't be returning undefined in this case.

(Note that it does return false if you zoom out - using the jsfiddle above, but still ... there's a bug there.)
Thank you for reporting, we will look at fixing this for version 4.7.