TileLayer url-parameter blankTile

1146
5
07-11-2019 12:43 AM
RomanKönig
New Contributor III

Is there any way to influence the blankTile=true|false URL parameter sent by a TileLayer object requesting map tiles?

I could not find anything related in the documentation and i see that all our TileLayer objects are sending false.

Want to set this to blankTile=true to avoid 404 errors logged into the browser console and webserver logfiles.

0 Kudos
5 Replies
JeromeCauchon
New Contributor III

Did you find a way to avoid 404 when tile does not exists?

0 Kudos
RomanKönig
New Contributor III

No. Unfortunately the blankTile parameter is not supported by the API.
I filed an ehancement request, but it was closed and stated as "not in product plan".

mgeorge
Esri Contributor

Hi Roman König‌ sorry for the confusion on this. You are right that normal usage of TileLayers should not be flooding the console with errors. However, one problem with requesting blankTiles is that if a user starts zoomed in, then you might run into a situation where no data is displayed despite there being data in a parent tile. We will be fixing the logic to properly request parent tiles when data for a tile at a given LOD is missing, and also avoid flooding the console with these errors. 

We're making an internal issue (#22922) to track this, not sure that this will make it in 4.13, but we can definitely address for 4.14. 

0 Kudos
DeniseDemone1
New Contributor

Was this issue ever resolved? Still seeing the console flooded with errors in 4.20.

0 Kudos
ChristopherCorliss1
New Contributor II

You could use RequestInterceptor (https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) to catch requests and replace the blankTile parameter. Something like this:

esriConfig.request.interceptors.push({
    urls: 'theUrl',
    before: function(params) {
        if (params.url.includes('?blankTile=false')) {
            params.url = params.url.replace('?blankTile=false', '?blankTile=true')
        }
    }
})