<?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: WebTileLayer won't work with this URL in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1339218#M82500</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;How to convert tile (x,y) as is the case with Google Maps, which is based on a regular Mercator. To columns and rows for the govmap website that the coordinates are Israel Transverse Mercator (ITM)&lt;/P&gt;&lt;P&gt;How do I set the coordinates to this URL:&amp;nbsp;&lt;A href="https://cdn.govmap.gov.il/020522B0B20R/L10/R00012d82/C0001013f.jpg" target="_blank"&gt;https://cdn.govmap.gov.il/020522B0B20R/L10/R00012d82/C0001013f.jpg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Based on this:&amp;nbsp;&lt;A href="https://cdn.govmap.gov.il/020522B0B20R/L{level}/R{row}/C{col}.png" target="_blank"&gt;https://cdn.govmap.gov.il/020522B0B20R/L{level}/R{row}/C{col}.png&lt;/A&gt;&amp;nbsp;or jpg&lt;/P&gt;&lt;P&gt;I am using C# .net&lt;/P&gt;&lt;P&gt;I tried this but it didn't work:&lt;/P&gt;&lt;P&gt;var url = "&lt;A href="https://cdn.govmap.gov.il/M2023ORT3TS/{zoom_gov}/{y_gov}/{x_gov}.jpg" target="_blank"&gt;https://cdn.govmap.gov.il/M2023ORT3TS/{zoom_gov}/{y_gov}/{x_gov}.jpg&lt;/A&gt;";&lt;/P&gt;&lt;P&gt;int til_x = (Convert.ToInt32(x));&lt;BR /&gt;int til_y = (int)Math.Pow(2, z) - Convert.ToInt32(y) - 1;&lt;BR /&gt;url = url.Replace("{zoom_gov}", "L" + ZOOM_LAYER_ALI.Split(',')[0]);&lt;BR /&gt;url = url.Replace("{y_gov}", "R" + til_y.ToString("X8").ToLower());&lt;BR /&gt;url = url.Replace("{x_gov}", "C" + til_x.ToString("X8").ToLower());`&lt;/P&gt;</description>
    <pubDate>Wed, 18 Oct 2023 16:55:51 GMT</pubDate>
    <dc:creator>FIXERROR</dc:creator>
    <dc:date>2023-10-18T16:55:51Z</dc:date>
    <item>
      <title>WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251220#M80047</link>
      <description>&lt;P&gt;Hi &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;I want to add to my map a WebTileLayer from this url :&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;A href="https://cdn.govmap.gov.il/LPD0BBK2022/L01/R00000060/C00000056.jpg" target="_blank"&gt;https://cdn.govmap.gov.il/LPD0BBK2022/L01/R00000060/C00000056.jpg &lt;/A&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;that I got from this site:&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;A href="https://www.govmap.gov.il/?c=204000,595000&amp;amp;z=0&amp;amp;lang=en" target="_blank"&gt;https://www.govmap.gov.il/?c=204000,595000&amp;amp;z=0&amp;amp;lang=en&lt;/A&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;this is my code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        const  layer = new WebTileLayer({
      urlTemplate:"https://cdn.govmap.gov.il/LPD0BBK2022/L{level}/R{row}/C{col}.jpg"
        });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I think that the Tile scheme of this cache is different or custom, so I could not load it to my map.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 12:38:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251220#M80047</guid>
      <dc:creator>Guy_srb</dc:creator>
      <dc:date>2023-01-25T12:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251257#M80048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/614653"&gt;@Guy_srb&lt;/a&gt;,&amp;nbsp;I tried to get it to work with that same service, but I ran into some 403 errors. Not sure if it's just a CORS error, or if the service is locked down to prevent access. What errors are you getting in the browser console?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:07:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251257#M80048</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2023-01-25T14:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251351#M80050</link>
      <description>&lt;P&gt;I'm getting 403 errors as well, so it's probably locked? I thought it didn't work becuase the col,row and level was diffrenet in this cache.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 15:47:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251351#M80050</guid>
      <dc:creator>Guy_srb</dc:creator>
      <dc:date>2023-01-25T15:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251412#M80052</link>
      <description>&lt;P&gt;&lt;SPAN&gt;It is not working&amp;nbsp;because the WebTileLayer.urlTemplate does not match the service's tiling scheme.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You are setting your urlTemplate to send&amp;nbsp;requests like this and this does not exist:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://cdn.govmap.gov.il/LPD0BBK2022/L0/R0/C0.jpg" target="_blank"&gt;https://cdn.govmap.gov.il/LPD0BBK2022/L0/R0/C0.jpg&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Looking at the network traffic not sure how this service is structured:&amp;nbsp;&lt;A href="https://www.govmap.gov.il/?c=204000,595000&amp;amp;z=0&amp;amp;lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.govmap.gov.il/?c=204000,595000&amp;amp;z=0&amp;amp;lang=en&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I see that rows and columns have some lettering system...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-25 at 9.01.55 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61216iEFF6DA4A780C018D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-25 at 9.01.55 AM.png" alt="Screenshot 2023-01-25 at 9.01.55 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can this map be used in third party apis? Did you check their terms of agreement? Looks like the map has a link the API at the bottom. I tried looking there but I could not find English page.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:14:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251412#M80052</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-01-25T17:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251449#M80053</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;was basically saying, WebTileLayer doesn't natively support this tiling scheme.&amp;nbsp; However, you can override the logic that generates the URL from the level, row, and column values so that the generated URLs do match that particular scheme:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const  layer = new WebTileLayer({
	urlTemplate: "https://cdn.govmap.gov.il/LPD0BBK2022/L{level}/R{row}/C{col}.jpg"
});

layer._addLeadingZeros = function(number, desiredLength) {
	var str = number.toString();

	while (str.length &amp;lt; desiredLength)
		str = "0" + str;

	return str;
};

layer.getTileUrl = function(level, row, col) {
	var lodIndex = level - this.tileInfo.lods[0].level;
	var url;

	if ((lodIndex &amp;gt;= 0) &amp;amp;&amp;amp; (lodIndex &amp;lt; this.tileInfo.lods.length)) {
		url = this.urlTemplate.replace(/\$\{level\}/g, this._addLeadingZeros(this.levelValues[level], 2));
		url = url.replace(/\$\{col\}/g, this._addLeadingZeros(col.toString(16), 8));
		url = url.replace(/\$\{row\}/g, this._addLeadingZeros(row.toString(16), 8));
	} else
		url = "data&amp;amp;colon;image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="; //one transparent pixel

	return url;
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 17:36:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1251449#M80053</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-10-18T17:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1287177#M81099</link>
      <description>&lt;P&gt;Thank you very much for the example!&lt;/P&gt;&lt;P&gt;By any chance there is a way to find out the service tile scheme?&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 10:37:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1287177#M81099</guid>
      <dc:creator>Guy_srb</dc:creator>
      <dc:date>2023-05-09T10:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1290743#M81205</link>
      <description>&lt;P&gt;Yes, you can determine the tile scheme by poking around a bit in the application's source code using your browser's developer tools.&amp;nbsp; For example, the tiling info can be seen by doing a search for tileInfo in the esriMap.js file, as shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tileInfo.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/71098i31FEE31AB2313CC3/image-size/large?v=v2&amp;amp;px=999" role="button" title="tileInfo.png" alt="tileInfo.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the lods (levels of detail), it appears you can find information for those in the request to GetBackgrounds:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lods.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/71099i775240B8F820A63D/image-size/large?v=v2&amp;amp;px=999" role="button" title="lods.png" alt="lods.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 17:49:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1290743#M81205</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-05-18T17:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1339218#M82500</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;How to convert tile (x,y) as is the case with Google Maps, which is based on a regular Mercator. To columns and rows for the govmap website that the coordinates are Israel Transverse Mercator (ITM)&lt;/P&gt;&lt;P&gt;How do I set the coordinates to this URL:&amp;nbsp;&lt;A href="https://cdn.govmap.gov.il/020522B0B20R/L10/R00012d82/C0001013f.jpg" target="_blank"&gt;https://cdn.govmap.gov.il/020522B0B20R/L10/R00012d82/C0001013f.jpg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Based on this:&amp;nbsp;&lt;A href="https://cdn.govmap.gov.il/020522B0B20R/L{level}/R{row}/C{col}.png" target="_blank"&gt;https://cdn.govmap.gov.il/020522B0B20R/L{level}/R{row}/C{col}.png&lt;/A&gt;&amp;nbsp;or jpg&lt;/P&gt;&lt;P&gt;I am using C# .net&lt;/P&gt;&lt;P&gt;I tried this but it didn't work:&lt;/P&gt;&lt;P&gt;var url = "&lt;A href="https://cdn.govmap.gov.il/M2023ORT3TS/{zoom_gov}/{y_gov}/{x_gov}.jpg" target="_blank"&gt;https://cdn.govmap.gov.il/M2023ORT3TS/{zoom_gov}/{y_gov}/{x_gov}.jpg&lt;/A&gt;";&lt;/P&gt;&lt;P&gt;int til_x = (Convert.ToInt32(x));&lt;BR /&gt;int til_y = (int)Math.Pow(2, z) - Convert.ToInt32(y) - 1;&lt;BR /&gt;url = url.Replace("{zoom_gov}", "L" + ZOOM_LAYER_ALI.Split(',')[0]);&lt;BR /&gt;url = url.Replace("{y_gov}", "R" + til_y.ToString("X8").ToLower());&lt;BR /&gt;url = url.Replace("{x_gov}", "C" + til_x.ToString("X8").ToLower());`&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 16:55:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1339218#M82500</guid>
      <dc:creator>FIXERROR</dc:creator>
      <dc:date>2023-10-18T16:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: WebTileLayer won't work with this URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1339249#M82501</link>
      <description>&lt;P&gt;The two tiling schemes are not the same, so there is not a one-to-one relationship between the tiles of each.&amp;nbsp; As seen in the Known Limitations section of the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html" target="_self"&gt;TileLayer&lt;/A&gt; documentation, "All tiled layers [in the same map] must have the same tiling scheme and SpatialReference."&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 17:44:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-won-t-work-with-this-url/m-p/1339249#M82501</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-10-18T17:44:38Z</dc:date>
    </item>
  </channel>
</rss>

