<?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 Adding 3rd party Weather Layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-3rd-party-weather-layer/m-p/1195327#M78033</link>
    <description>&lt;P&gt;Hey, I'm looking to add a custom feature layer (weather layer).&lt;/P&gt;&lt;P&gt;I've got the documentation which basically saying to call the URL and get the relevant data:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;"&lt;A href="http://maps.customweather.com/cw_tiles/5-5imZ7MogxLQSd-NFMPy5aPfZAEBj3axcJeJeBh38PtBSPb_cgTv" target="_blank" rel="noopener"&gt;http://maps.customweather.com/cw_tiles/5-5imZ7MogxLQSd-NFMPy5aPfZAEBj3axcJeJeBh38PtBSPb_cgTv&lt;/A&gt; hRqEAQhlNSI/synoptic_temp/"+Tile2Quad(a.x,a.y,b)+".png";&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However as you can see, i need to pass some arguments to the url, which are the extent basically.&lt;/P&gt;&lt;P&gt;This code example is for Google maps.&lt;/P&gt;&lt;P&gt;here is the Tile2Quad function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function Tile2Quad(tx, ty, zl) {
    var quad = "";
    for (var i = zl; i &amp;gt; 0; i--) {
        var mask = 1 &amp;lt;&amp;lt; (i - 1);
        var cell = 0;
        if ((tx &amp;amp; mask) !=
            0) {
            cell++;
        }
        if ((ty &amp;amp; mask) != 0) {
            cell += 2;
        }
        quad += cell;
    }
    return quad;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is, how can i convert this code to esri, get the Geometry, and add this weather layer to my application.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 08:23:03 GMT</pubDate>
    <dc:creator>orahlagi</dc:creator>
    <dc:date>2022-07-25T08:23:03Z</dc:date>
    <item>
      <title>Adding 3rd party Weather Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-3rd-party-weather-layer/m-p/1195327#M78033</link>
      <description>&lt;P&gt;Hey, I'm looking to add a custom feature layer (weather layer).&lt;/P&gt;&lt;P&gt;I've got the documentation which basically saying to call the URL and get the relevant data:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;"&lt;A href="http://maps.customweather.com/cw_tiles/5-5imZ7MogxLQSd-NFMPy5aPfZAEBj3axcJeJeBh38PtBSPb_cgTv" target="_blank" rel="noopener"&gt;http://maps.customweather.com/cw_tiles/5-5imZ7MogxLQSd-NFMPy5aPfZAEBj3axcJeJeBh38PtBSPb_cgTv&lt;/A&gt; hRqEAQhlNSI/synoptic_temp/"+Tile2Quad(a.x,a.y,b)+".png";&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However as you can see, i need to pass some arguments to the url, which are the extent basically.&lt;/P&gt;&lt;P&gt;This code example is for Google maps.&lt;/P&gt;&lt;P&gt;here is the Tile2Quad function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function Tile2Quad(tx, ty, zl) {
    var quad = "";
    for (var i = zl; i &amp;gt; 0; i--) {
        var mask = 1 &amp;lt;&amp;lt; (i - 1);
        var cell = 0;
        if ((tx &amp;amp; mask) !=
            0) {
            cell++;
        }
        if ((ty &amp;amp; mask) != 0) {
            cell += 2;
        }
        quad += cell;
    }
    return quad;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is, how can i convert this code to esri, get the Geometry, and add this weather layer to my application.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 08:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-3rd-party-weather-layer/m-p/1195327#M78033</guid>
      <dc:creator>orahlagi</dc:creator>
      <dc:date>2022-07-25T08:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3rd party Weather Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-3rd-party-weather-layer/m-p/1195728#M78056</link>
      <description>&lt;P&gt;I haven't tested this, but it seems to me you could use a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html" target="_self"&gt;WebTiledLayer&lt;/A&gt; and override the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#getTileUrl" target="_self"&gt;getTileURL&lt;/A&gt; function like so:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var layer = new WebTiledLayer({
	id: "myLayerID",
	visible: true,
	urlTemplate: "http://maps.customweather.com/cw_tiles/5-5imZ7MogxLQSd-NFMPy5aPfZAEBj3axcJeJeBh38PtBSPb_cgTvhRqEAQhlNSI/synoptic_temp/{level}/{col}/{row}.png"
});

layer.getTileUrl = function(zl, ty, tx) {
	var quad = "";
	for (var i = zl; i &amp;gt; 0; i--) {
		var mask = 1 &amp;lt;&amp;lt; (i - 1);
		var cell = 0;
		if ((tx &amp;amp; mask) != 0) {
			cell++;
		}
		if ((ty &amp;amp; mask) != 0) {
			cell += 2;
		}
		quad += cell;
	}
	return "http://maps.customweather.com/cw_tiles/5-5imZ7MogxLQSd-NFMPy5aPfZAEBj3axcJeJeBh38PtBSPb_cgTvhRqEAQhlNSI/synoptic_temp/" + quad + ".png";
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the urlTemplate value in the constructor is bogus, but that's ok because it will never be used.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 02:45:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-3rd-party-weather-layer/m-p/1195728#M78056</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-07-26T02:45:22Z</dc:date>
    </item>
  </channel>
</rss>

