@@ -12,7 +12,7 @@ const view = require("esri/views/View").views.getItemAt(0);
12
12
13
13
``` js
14
14
view .map .allLayers .forEach ((layer , index ) => {
15
- console .log (index, " -> " , layer .title );
15
+ console .log (` ${ index} -> ${ layer .title } ` );
16
16
});
17
17
```
18
18
@@ -24,7 +24,7 @@ Step 1: check that the LayerView gets created
24
24
const layer = view .map .allLayers .getItemAt (index);
25
25
26
26
view .whenLayerView (layer)
27
- .then (layerView => console .log (layerView))
27
+ .then (( layerView ) => console .log (layerView))
28
28
// if there were problems with the layerview, you'll get an error here
29
29
.catch (console .error );
30
30
```
@@ -100,35 +100,15 @@ You might need the extent to set a [clippingArea](https://developers.arcgis.com/
100
100
101
101
---
102
102
103
- ### ⌛ Show when a layer finished updating
104
-
105
- ``` js
106
-
107
- view .whenLayerView (layer)
108
- .then (layerView => {
109
- layerView .watch (" updating" , value => {
110
- if (! value) {
111
- console .log (` Layer ${ layer .title } finished updating.` );
112
- }
113
- });
114
- })
115
- .catch (console .error );
116
-
117
- ```
118
-
119
- ---
120
-
121
103
### ⌛ Show when the view finished updating
122
104
123
105
``` js
124
106
125
107
// works reliably only with version 4.12
126
108
127
- view .when (() => {
128
- view .watch (" updating" , value => {
129
- const status = value ? " Updating" : " Finished updating"
130
- console .log (status);
131
- });
109
+ view .watch (" updating" , (value ) => {
110
+ const status = value ? " is updating" : " finished updating" ;
111
+ console .log (` View ${ status} .` );
132
112
});
133
113
134
114
```
@@ -157,4 +137,3 @@ view.when(() => {
157
137
});
158
138
});
159
139
```
160
-
0 commit comments