Select to view content in your preferred language

Custom tile layer bug

538
1
11-10-2019 04:15 AM
EfimDezhin
New Contributor

I try to reproduce custom tile layer (here) but it show me wrong tiles.

Is it bug? Is it possible to fix?

Kind regards,

Efim Dezhin

0 Kudos
1 Reply
RalucaNicola1
Esri Contributor

Hi Efim,

this is a documentation problem, I'll work on getting this fixed in the next documentation update. Until then, the solution is to pass the AbortSignal in the esriRequest method: 

// This method fetches tiles for the specified level and size.
// Override this method to process the data returned from the server.
fetchTile: function(level, row, col, options) {
   // call getTileUrl() method to construct the URL to tiles
   // for a given level, row and col provided by the LayerView
   var url = this.getTileUrl(level, row, col);

   // request for tiles based on the generated url
   return esriRequest(url, {
      responseType: "image",
      signal: options.signal
   }).then(...)
...
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Here's the working sample: https://codepen.io/ralucanicola/pen/abbjwax?editors=1000 

Thank you for reporting this!