<?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: Set TileMatrixSetId for WMTS in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-tilematrixsetid-for-wmts/m-p/1549499#M85909</link>
    <description>&lt;P&gt;Hi, thank for your feedback. This seems to be a "extremelly hot" fix, because - in this case I should probably change TILEMATRIX, TILEROW and TILECOL too. This is something that esri object should calculate.&lt;/P&gt;&lt;P&gt;I hope there is standard way to specify tileMatrixSet, because when using Online ArcGisMap Viewer I have to select the TileMatrixSet to use before the layer is added to map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2024 14:16:22 GMT</pubDate>
    <dc:creator>tomasivan</dc:creator>
    <dc:date>2024-10-17T14:16:22Z</dc:date>
    <item>
      <title>Set TileMatrixSetId for WMTS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-tilematrixsetid-for-wmts/m-p/1549000#M85903</link>
      <description>&lt;P&gt;Hi, I have MapView with basemap (wkid 5514). When I add this specific WMTS layer :&amp;nbsp;&lt;A href="https://services.sentinel-hub.com/ogc/wmts/9c4df810-8939-4ef5-9962-fd51bf66ece8" target="_blank" rel="noopener"&gt;https://services.sentinel-hub.com/ogc/wmts/9c4df810-8939-4ef5-9962-fd51bf66ece8&lt;/A&gt;&lt;/P&gt;&lt;P&gt;it is rendered on wrong place, it is moved hundreds kilometers to north.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The same behaviour can be simulated on online arcgis map viewer, when setting this wmts as basemap first :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://zbgisws.skgeodesy.sk/zbgis_ortofoto_wmts/service.svc/get" target="_blank" rel="noopener"&gt;https://zbgisws.skgeodesy.sk/zbgis_ortofoto_wmts/service.svc/get&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Problem is with the sentinel layer and tileMatrixSet used : CZE, which supports urn:ogc:def:crs:EPSG::5514,&amp;nbsp; but its tile sizes height != width :&amp;nbsp;&lt;BR /&gt;&amp;lt;TileWidth&amp;gt;512&amp;lt;/TileWidth&amp;gt;&lt;BR /&gt;&amp;lt;TileHeight&amp;gt;286&amp;lt;/TileHeight&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I can fix this problem only in ArcGis online viewer using another tileMatrixSetId : UTM33N, which could be acceptable.&amp;nbsp;&lt;BR /&gt;But I'm not able to set this tileMatrixSet when creating WMTSLayer :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;let &lt;/SPAN&gt;tileMatrixSet = &lt;SPAN&gt;'UTM33N';&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;let wmtsOptions = {&lt;BR /&gt;&lt;/FONT&gt;id:'my-internal-id',&lt;BR /&gt;url: '&lt;A href="https://services.sentinel-hub.com/ogc/wmts/9c4df810-8939-4ef5-9962-fd51bf66ece8" target="_blank" rel="noopener"&gt;https://services.sentinel-hub.com/ogc/wmts/9c4df810-8939-4ef5-9962-fd51bf66ece8&lt;/A&gt;',&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;spatialReference: this.mapView.spatialReference,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;};&lt;BR /&gt;wmtsOptions['activeLayer'] = {id: parameters.activeLayer};&lt;BR /&gt;wmtsOptions['tileMatrixSetId'] = tileMatrixSet;&lt;BR /&gt;wmtsOptions['tileMatrixSet'] = tileMatrixSet;&lt;BR /&gt;let lyr = new WMTSLayer(wmtsOptions);&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I tried to set tileMatrixSetId for sublayers too :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;lyr.&lt;SPAN&gt;load&lt;/SPAN&gt;().&lt;SPAN&gt;then&lt;/SPAN&gt;(() =&amp;gt; {&lt;BR /&gt;  &lt;SPAN&gt;let &lt;/SPAN&gt;sublayers = (lyr &lt;SPAN&gt;as &lt;/SPAN&gt;WMTSLayer).&lt;SPAN&gt;sublayers&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  let &lt;/SPAN&gt;activeLayer = (lyr &lt;SPAN&gt;as any&lt;/SPAN&gt;).&lt;SPAN&gt;activeLayer&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;  activeLayer.&lt;SPAN&gt;tileMatrixSetId &lt;/SPAN&gt;= tileMatrixSet&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;  &lt;SPAN&gt;if&lt;/SPAN&gt;(sublayers?.&lt;SPAN&gt;length&lt;/SPAN&gt;){&lt;BR /&gt;    sublayers.&lt;SPAN&gt;forEach&lt;/SPAN&gt;(sublayer =&amp;gt; {&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;      sublayer.&lt;SPAN&gt;tileMatrixSetId &lt;/SPAN&gt;= tileMatrixSet&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    })&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;  }&lt;BR /&gt;  lyr.&lt;SPAN&gt;load&lt;/SPAN&gt;().&lt;SPAN&gt;then&lt;/SPAN&gt;(() =&amp;gt; {&lt;BR /&gt;    &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'reloaded lyr: '&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;lyr)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;  })&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;})&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I can see in console, that tileMatrixSetId is set to&amp;nbsp;UTM33N, bet the request sent by browser have still TILEMATRIXSET=CZE.&lt;BR /&gt;&lt;BR /&gt;How can I specify the the tileMatrixSet for WMTS layer ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 18:51:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-tilematrixsetid-for-wmts/m-p/1549000#M85903</guid>
      <dc:creator>tomasivan</dc:creator>
      <dc:date>2024-10-16T18:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set TileMatrixSetId for WMTS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-tilematrixsetid-for-wmts/m-p/1549326#M85907</link>
      <description>&lt;P&gt;If all you're trying to do is replace TILEMATRIXSET=CZE with TILEMATRIXSET=UTM33N in the request URLs, you can do that fairly easily with a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor" target="_self"&gt;RequesInterceptor&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;esriConfig.request.interceptors.push({
	urls: ["https://services.sentinel-hub.com/ogc/wmts/9c4df810-8939-4ef5-9962-fd51bf66ece8"],
	before: function(params) {
		var index1 = params.url.indexOf("TILEMATRIXSET=");

		if (index1 &amp;gt; 0) {
			var url = params.url.substring(0, index1) + "TILEMATRIXSET=UTM33N";
			var index2 = params.url.indexOf("&amp;amp;", index1);

			if (index2 &amp;gt; index1)
				url += params.url.substr(index2);

			params.url = url;
		}

		return null;
	}
});&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Oct 2024 23:48:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-tilematrixsetid-for-wmts/m-p/1549326#M85907</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-10-16T23:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set TileMatrixSetId for WMTS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-tilematrixsetid-for-wmts/m-p/1549499#M85909</link>
      <description>&lt;P&gt;Hi, thank for your feedback. This seems to be a "extremelly hot" fix, because - in this case I should probably change TILEMATRIX, TILEROW and TILECOL too. This is something that esri object should calculate.&lt;/P&gt;&lt;P&gt;I hope there is standard way to specify tileMatrixSet, because when using Online ArcGisMap Viewer I have to select the TileMatrixSet to use before the layer is added to map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 14:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-tilematrixsetid-for-wmts/m-p/1549499#M85909</guid>
      <dc:creator>tomasivan</dc:creator>
      <dc:date>2024-10-17T14:16:22Z</dc:date>
    </item>
  </channel>
</rss>

