How to know when a VectorTileLayer is finished rendering? (ArcGIS API for JavaScript)

459
7
01-20-2020 02:34 PM
Highlighted
New Contributor

Hi,

I would like to use VectorTileLayer

But I can't find any event that fires when layer rendering is done.

'load' event fires:

Fires after layer properties for the layer are successfully populated.

So basically load event it's very quick (it's a small json) but it's not what I am looking for.

'update-end' not fires.

maybe there is other method to determine if VectorTileLayer is finish to render.

Br,

Dvir.

Reply
0 Kudos
7 Replies
Highlighted
New Contributor III

Try the event "update" which is part of inherited class "Layer". 

Also try other events "update-end" and "update-start" Layer | API Reference | ArcGIS API for JavaScript 3.31 

Reply
0 Kudos
Highlighted
New Contributor

Hi,

I tried 'update' and 'update-end' unfortunately it's not working.

example code can see here:

https://codepen.io/Dvirus/pen/wvBRgjg?editors=1001 

Br,

Dvir.

Reply
0 Kudos
Highlighted
Esri Contributor

Hi there, 

The `update-start` and `update-end` events are not firing for the VectorTileLayer. We created an issue for this and I will give you an update once it is fixed. In meantime, please try using Map.update-end event.

-Undral

Highlighted
New Contributor

Hi ,

Thanks for create issue for this and I will glad to be updated once it is fixed.

unfortunately even Map.update-endevent not fired.

I have update the codepen

https://codepen.io/Dvirus/pen/wvBRgjg?editors=1000 

Br,

Dvir.

Reply
0 Kudos
Highlighted
MVP Honored Contributor

If you add a basemap to the map constructor, the map's "update-start" and "update-end" events will fire.

var map = new Map("map", {
center: [2.3508, 48.8567], // longitude, latitude
zoom: 7,
basemap: "topo"
});
Reply
0 Kudos
Highlighted
New Contributor

Hi there,

basemap "topo" It is not a vector map

I need to use "topo-vector" which it's a vector map.

The problem is that I need to use vector map but I can't know when it's finish to redraw/render.

None of those vector maps not fires 'update-end':

   dark-gray-vector,
   gray-vector,
   streets-vector,
   topo-vector,
   streets-night-vector,
   streets-relief-vector,
   streets-navigation-vector

I tried also to add the layer to map. still the same.

Thanks toUndral Batsukh  for opening issue for this, and I hope that issue will be fixed soon.

Br,

Dvir.

Reply
0 Kudos
Highlighted
Esri Contributor

Hi there, 

I should have checked for the map update events when the basemap is vector tile layer. I confirmed that map update events are indeed not firing for vectortilelayer basemaps. This issue will be fixed at our next release (3.32). 

Thank you for reporting this issue,

-Undral

Reply
0 Kudos