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
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:
<SPAN class="comment token">// This method fetches tiles for the specified level and size.</SPAN> <SPAN class="comment token">// Override this method to process the data returned from the server.</SPAN> fetchTile<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>level<SPAN class="punctuation token">,</SPAN> row<SPAN class="punctuation token">,</SPAN> col<SPAN class="punctuation token">,</SPAN> options<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">// call getTileUrl() method to construct the URL to tiles</SPAN> <SPAN class="comment token">// for a given level, row and col provided by the LayerView</SPAN> <SPAN class="keyword token">var</SPAN> url <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">getTileUrl</SPAN><SPAN class="punctuation token">(</SPAN>level<SPAN class="punctuation token">,</SPAN> row<SPAN class="punctuation token">,</SPAN> col<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// request for tiles based on the generated url</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="token function">esriRequest</SPAN><SPAN class="punctuation token">(</SPAN>url<SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN> responseType<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"image"</SPAN><SPAN class="punctuation token">,</SPAN> signal<SPAN class="punctuation token">:</SPAN> options<SPAN class="punctuation token">.</SPAN>signal <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">then</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Here's the working sample: https://codepen.io/ralucanicola/pen/abbjwax?editors=1000
Thank you for reporting this!
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.