<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to create a custom tile layer (BaseTileLayer) using 512x512 tiles? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1196649#M78088</link>
    <description>&lt;P&gt;Thanks for your help and example. This worked for me as well just now.&amp;nbsp;&lt;BR /&gt;Looking at this more closely, I'm trying to understand. How do we know, from the API pages, whether a property is settable or whether it can only be set up as part of the constructor? I know that certain properties are "read-only", so they can not be changed at all. But how do I know if a property can be configured in the constructor only?&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 04:55:27 GMT</pubDate>
    <dc:creator>RyanSutcliffe</dc:creator>
    <dc:date>2022-07-28T04:55:27Z</dc:date>
    <item>
      <title>How to create a custom tile layer (BaseTileLayer) using 512x512 tiles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1194956#M78022</link>
      <description>&lt;P&gt;In an &lt;STRONG&gt;ArcGIS JavaScript API&lt;/STRONG&gt; project I am working on, we have a source dataset from an API that supports 512x512 as well as 256x256 tiling schemes. I'm keen to test if the 512x512 scheme improves performance on large and high resolution devices but cannot figure out how to set it up with the ArcGIS JavaScript API's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html" target="_self"&gt;BaseTileLayer&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I've got the 256x256 version working in an approach akin to the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-lerc-2d/" target="_self"&gt;ESRI example here&amp;nbsp;&lt;/A&gt;for a custom BaseTileLayer in an ArcGIS API map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;- There is no mention of tiling scheme support or limitations on the BaseTileLayer API page, but looking at the API page of the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html" target="_self"&gt;TileLayer&lt;/A&gt;, there seems to be&amp;nbsp;support for 512x512 tiling schemes, so I assume this extends to the BaseTileLayer as well.&lt;/P&gt;&lt;P&gt;- I see that there is a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html" target="_self"&gt;TileInfo&lt;/A&gt; property on the BaseTileLayer which has a &lt;STRONG&gt;size&lt;/STRONG&gt; property, although its not 100% clear to me how this can be set.&lt;/P&gt;&lt;P&gt;What I Tried&lt;/P&gt;&lt;P&gt;I've tried using the 512x512 source dataset in my layer. It draws but with artifacts that suggest something is wrong with the tiling.&amp;nbsp;I've then tried modifying the tileInfo property on the baseTileLayer after the layer is created like so:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const CustomTileLayer = baseTileLayer.createSubClass({
...
})

let myCustomLayer = new CustomTileLayer({
...
});

myCustomLayer.tileInfo.size = 512;&lt;/LI-CODE&gt;&lt;P&gt;This will cause errors and nothing to draw. On a serverside rendered layer, the esriRequest within the fetchTile method will fail with 'unable to load [url]'. On a clientside rendered layer, the fail will happen when I try to read the data from the fetched ArrayBuffer stream of data:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const response = await esriRequest(url, {
	method: "GET",
	referrer: "origin",
	signal: options &amp;amp;&amp;amp; options.signal,
	headers: {
	  Accept: "*/*",
	},
	responseType: "array-buffer",
  });

  const buffer = response.data;
  // buffer.bytelength = 0?
  
  //consuming buffer fails.&lt;/LI-CODE&gt;&lt;P&gt;Can anyone spot what I am doing wrong or missing? What is the trick to configure a baseTileLayer with a custom 512x512 tiling scheme correctly?&lt;/P&gt;&lt;P&gt;Unfortunately the source dataset I am consuming is not public so I can't share any codePen examples of what I've tried or what I'm doing with 256x256 default approach?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 15:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1194956#M78022</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2022-07-22T15:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom tile layer (BaseTileLayer) using 512x512 tiles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1196434#M78084</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You cannot directly set the TileInfo.size as you are doing. It needs to be set in the custom layer constructor as shown below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const TintLayer = BaseTileLayer.createSubclass({
  constructor() {
    this.tileInfo = TileInfo.create({
      size: 512,
      spatialReference: { wkid: 102100 }
    });
  },
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please take a look at &lt;A href="https://codepen.io/U_B_U/pen/bGvomQa?editors=1000" target="_self"&gt;this codepen&lt;/A&gt; for how it is done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here a link to the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create" target="_self"&gt;TileInfo.create()&lt;/A&gt; method.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 16:47:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1196434#M78084</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-07-27T16:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom tile layer (BaseTileLayer) using 512x512 tiles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1196649#M78088</link>
      <description>&lt;P&gt;Thanks for your help and example. This worked for me as well just now.&amp;nbsp;&lt;BR /&gt;Looking at this more closely, I'm trying to understand. How do we know, from the API pages, whether a property is settable or whether it can only be set up as part of the constructor? I know that certain properties are "read-only", so they can not be changed at all. But how do I know if a property can be configured in the constructor only?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 04:55:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1196649#M78088</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2022-07-28T04:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom tile layer (BaseTileLayer) using 512x512 tiles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1197465#M78105</link>
      <description>&lt;P&gt;Chatting with a support rep at ESRI Canada he pointed out that this is because we are using the 'createSubClass' method on the BaseTileLayer class to instantiate a new instance which is a (subclass of?) &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#createSubclass" target="_self"&gt;Accessor.&lt;/A&gt;&amp;nbsp;Looking at that class we can see properties are not adjusted directly but via &lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#properties" target="_self"&gt;setters and getters.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;So we&amp;nbsp;&lt;EM&gt;could&amp;nbsp;&lt;/EM&gt;change the tileInfo size property via something like:&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;myCustomTileLayer.set('tileInfo.size', 512)&lt;/LI-CODE&gt;&lt;P&gt;However logically it makes more sense to set up this in the constructor as above. I can't think of a valid use case where you'd want to switch the tiling scheme of a layer after it was already in use.&lt;/P&gt;&lt;P&gt;Here is&amp;nbsp; a &lt;A href="https://codepen.io/tthompsonesri-the-styleful/pen/RwMjKWp?editors=1000" target="_self"&gt;codePen example&lt;/A&gt; an ESRI Canada rep set up for me showing, just for interest, that using set() works as well (see line 145).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 16:51:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1197465#M78105</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2022-07-29T16:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom tile layer (BaseTileLayer) using 512x512 tiles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1197521#M78108</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;You have to set the tileInfo in the layer constructor. The tileInfo.size is used to derive the layer's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods" target="_self"&gt;tileInfo.lods&lt;/A&gt;&amp;nbsp; and eventually MapView.constraints.LODs (if it is base or only layer). Try zooming in and out in your codepen you can see that LODS calculations are incorrect (visually).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 17:55:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-custom-tile-layer-basetilelayer/m-p/1197521#M78108</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-07-29T17:55:33Z</dc:date>
    </item>
  </channel>
</rss>

