# imageryProvider/ ImageryLayer redraw tiles

**URL:** <https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144>\
**Category:** CesiumJS\
**Created:** [March 16, 2020, 2:01am UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144 "2020-03-16T02:01:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Majid\_Hojati](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@Majid\_Hojati](https://community.cesium.com/u/Majid_Hojati)\
**Post date:** [March 16, 2020, 2:01am UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144/1 "2020-03-16T02:01:29Z")

</div>

Hi,

Is there any functions such as redraw or refresh that when we change imageryProvider’s settings it redraws tiles on the globe? I searched the api for these objects but could not find any functions.

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [March 16, 2020, 7:11pm UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144/2 "2020-03-16T19:11:19Z")

</div>

Can you describe your use case here? If you have tiles that update over time using a time dynamic imagery provider is probably the best solution: [https://sandcastle.cesium.com/index.html?src=Web%20Map%20Tile%20Service%20with%20Time.html](https://sandcastle.cesium.com/index.html?src=Web%20Map%20Tile%20Service%20with%20Time.html)

Otherwise, you could remove and re-add the imagery provider.

---

<div class="post-metadata">

**Author:** ![Majid\_Hojati](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@Majid\_Hojati](https://community.cesium.com/u/Majid_Hojati)\
**Post date:** [March 16, 2020, 8:31pm UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144/3 "2020-03-16T20:31:15Z")

</div>

Hi,  
In my case the tile’s style changes by a parameter in the url. so when user changes that parameter layer must be loaded again. in the leaflet there is a function named `redraw` which draws all the tiles of a layer from scratch. I was wondering if there is something similar in cesium as well.

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [March 16, 2020, 10:00pm UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144/4 "2020-03-16T22:00:30Z")

</div>

What type of imagery provider are you using? If it’s something like the UrlTemplateImageryProvider, where the URL is readonly, I think recreating the provider would be the right way to go.

---

<div class="post-metadata">

**Author:** ![Majid\_Hojati](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@Majid\_Hojati](https://community.cesium.com/u/Majid_Hojati)\
**Post date:** [March 17, 2020, 2:50am UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144/5 "2020-03-17T02:50:38Z")

</div>

I am using a kind of customized imageryProvider based on this sourcecode  
[https://github.com/TerriaJS/terriajs/blob/master/lib/Map/MapboxVectorTileImageryProvider.js](https://github.com/TerriaJS/terriajs/blob/master/lib/Map/MapboxVectorTileImageryProvider.js)

I have two options. either change the url or change the stylefunction. I think they both will effect the newly loaded tiles but I think there must be a way to re render the already downloaded tiles as well otherwise there will be a miss match between the already loaded tiles and new tiles.

---

<div class="post-metadata">

**Author:** ![davenquinn](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/davenquinn/32/1987_2.png) [@davenquinn](https://community.cesium.com/u/davenquinn)\
**Post date:** [April 6, 2021, 4:49pm UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144/6 "2021-04-06T16:49:00Z")

</div>

I am running into this issue too, in a very similar context. I am using an ImageryProvider to render vector tiles provided by a webgl context, and occasionally need to change the style to re-filter the dataset. I basically need a “refresh” method that requests the same tiles that are currently displayed and swaps them. I could reload the layer, potentially, but this does not seem like a very clean solution.

It looks like there is similar logic in the [`WebMapTileServiceImageryProvider`](https://cesium.com/docs/cesiumjs-ref-doc/WebMapTileServiceImageryProvider.html), dealing with “time dynamic” layers, but I’m not sure how to wire that up in this case.

---

<div class="post-metadata">

**Author:** ![ShayBM\_Datumate](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@ShayBM\_Datumate](https://community.cesium.com/u/ShayBM_Datumate)\
**Post date:** [December 29, 2021, 11:48am UTC](https://community.cesium.com/t/imageryprovider-imagerylayer-redraw-tiles/9144/7 "2021-12-29T11:48:09Z")

</div>

Following your lead on `WebMapTileServiceImageryProvider` I dug into the code and found that the base class of `ImageryProvider`s has an internal method called `_reload()` that does just that - requests all the tiles that are displayed again. Obviously I don’t like using internal methods, but I’ve been using it and it seems to do what I needed it to do.
