<?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 use style-change event of VectorTileLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502432#M46641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuki,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was also not able to get the "style-change" event to fire &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;using the setStyle method&lt;/SPAN&gt;. This might be an issue with Beta 2, but I will do some more research.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime, it is possible to use .then() after the setStyle, because setStyle returns a promise. See fiddle below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsfiddle.net/noahs42/2z7pzu9f"&gt;http://jsfiddle.net/noahs42/2z7pzu9f&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2015 22:50:18 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2015-11-25T22:50:18Z</dc:date>
    <item>
      <title>How to use style-change event of VectorTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502431#M46640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;VectorTileLayer class has style-change event.&lt;/P&gt;&lt;P&gt;This event don't fire even if change a style of VectorTileLayer using setStyle methods.&lt;/P&gt;&lt;P&gt;I want to use style-change event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var map = new Map();

//make map view and bind it to the map
var view = new MapView({
&amp;nbsp; container: "viewDiv",
&amp;nbsp; map: map,
&amp;nbsp; center: [-100.33, 25.69],
&amp;nbsp; zoom: 10
});

var tileLyr = new VectorTileLayer({
&lt;SPAN&gt;&amp;nbsp; url: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.arcgis.com%2Fsharing%2Frest%2Fcontent%2Fitems%2F3b8814f6ddbd485cae67e8018992246e%2Fresources%2Fstyles%2Froot.json" target="_blank"&gt;http://www.arcgis.com/sharing/rest/content/items/3b8814f6ddbd485cae67e8018992246e/resources/styles/root.json&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
});
map.add(tileLyr);

on(changeStyle, "click", function() {
&lt;SPAN&gt;&amp;nbsp; tileLyr.setStyle("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.arcgis.com%2Fsharing%2Frest%2Fcontent%2Fitems%2F103d0c867a9640e3a6d44224196de1fd%2Fresources%2Fstyles%2Froot.json" target="_blank"&gt;http://www.arcgis.com/sharing/rest/content/items/103d0c867a9640e3a6d44224196de1fd/resources/styles/root.json&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;
});

tileLyr.on("style-change", function(){
&amp;nbsp; console.log("style changed");
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:03:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502431#M46640</guid>
      <dc:creator>YukiOZAWA</dc:creator>
      <dc:date>2021-12-11T22:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use style-change event of VectorTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502432#M46641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuki,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was also not able to get the "style-change" event to fire &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;using the setStyle method&lt;/SPAN&gt;. This might be an issue with Beta 2, but I will do some more research.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime, it is possible to use .then() after the setStyle, because setStyle returns a promise. See fiddle below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsfiddle.net/noahs42/2z7pzu9f"&gt;http://jsfiddle.net/noahs42/2z7pzu9f&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2015 22:50:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502432#M46641</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2015-11-25T22:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use style-change event of VectorTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502433#M46642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Noah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to try your sample and use promise of setStyle.&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 04:09:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502433#M46642</guid>
      <dc:creator>YukiOZAWA</dc:creator>
      <dc:date>2015-11-26T04:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use style-change event of VectorTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502434#M46643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuki,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, the 'style-change' event is not working in 4.0. We'll remove it from the documentation. You can use .then() as Noah suggested, or you can watch the style property on the layer like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;tileLyr.watch("style", function(newStyle, formerStyle){
&amp;nbsp; console.log("style changed from ", formerStyle, " to ", newStyle);
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Watching properties is discussed here: &lt;A href="https://developers.arcgis.com/javascript/beta/guide/working-with-props/index.html" title="https://developers.arcgis.com/javascript/beta/guide/working-with-props/index.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Working with properties | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:03:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-style-change-event-of-vectortilelayer/m-p/502434#M46643</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2021-12-11T22:03:17Z</dc:date>
    </item>
  </channel>
</rss>

