<?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: Getting colour of outline or fill relating to FeatureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-colour-of-outline-or-fill-relating-to/m-p/1494158#M84889</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yea i did some minor magic with your sdk to make things work.&amp;nbsp;&lt;SPAN&gt;It makes no sense for it to be referencing the inherited parent class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;QOL recommendation the ESRI team updates the SDK to return the actual Renderer class being used by the layer. User can determine type using the type property that is inherited from Renderer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; export class FeatureLayer {
// code omitted for brevity
   /**
     * The renderer assigned to the layer.
     *
     * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer)
     */
    renderer: SimpleRenderer | UniqueValueRenderer | PieChartRenderer | HeatmapRenderer | ClassBreaksRenderer| DotDensityRenderer; // just grabbed a few
// code omitted for brevity
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at the SDK doesn't look like it would result in breaking changes, it would make it more flexible, and could actually help the ESRI team long term by simplifying some future refactors and feature developments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2024 04:45:03 GMT</pubDate>
    <dc:creator>Aeseir</dc:creator>
    <dc:date>2024-06-18T04:45:03Z</dc:date>
    <item>
      <title>Getting colour of outline or fill relating to FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-colour-of-outline-or-fill-relating-to/m-p/1491273#M84855</link>
      <description>&lt;P&gt;I want to get the value of the fill and outline for a FeatureLayer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously for a FeatureLayer of type polygon you would do&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;featureLayer.renderer.get("symbol.outline.color") // get outline color
featureLayer.renderer.get("symbol.color") // fill color&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;As of 4.28,&amp;nbsp;`Accessor.get` is deprecated in favor of using optional chaining().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;If you apply the chaining&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;featureLayer.renderer?.symbol?.outline?.color // will lose its mind if you have linter on&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current workaround is to cast the featureLayer to any before using chaining.&lt;/P&gt;&lt;P&gt;If you have&amp;nbsp;&lt;SPAN&gt;no-explicit-any in your linter the above goes mental and you back at square one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is the proper way to get the values, i must be missing something obivious.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 06:41:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-colour-of-outline-or-fill-relating-to/m-p/1491273#M84855</guid>
      <dc:creator>Aeseir</dc:creator>
      <dc:date>2024-06-13T06:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Getting colour of outline or fill relating to FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-colour-of-outline-or-fill-relating-to/m-p/1491902#M84859</link>
      <description>&lt;P&gt;I'm surprised this ever worked&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/546199"&gt;@Aeseir&lt;/a&gt;&amp;nbsp;there isn't a symbol property on the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#properties-summary" target="_self"&gt;Renderer&lt;/A&gt; class.&amp;nbsp; Since many renderers can have multiple symbols associated with them, but&amp;nbsp;I guess this approach might work if the renderer was a SimpleRenderer and the symbol was a SimpleFillSymbol?&amp;nbsp; TypeScript would defiantly complain without doing a lot of casting like this but it's really ugly and I wouldn't suggest it, but I didn't get any typescript or linting errors.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sage_Wall_0-1718313000975.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107021iA841EADE642558C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sage_Wall_0-1718313000975.png" alt="Sage_Wall_0-1718313000975.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would suggest querying the feature service for the specific feature's who's symbol outline you want to grab with &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures" target="_self"&gt;queryFeatures()&lt;/A&gt;, and then get the outline from the graphic property on the feature.&amp;nbsp; &amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#graphic" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#graphic&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for linting and optional chaining I don't seem to have an issue when using this eslint config I just get an error saying renderer doesn't have a symbol property.&amp;nbsp; Maybe it's something in your linting configuration?&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;{
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended"
    ],
    "overrides": [
    ],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "ecmaVersion": "latest",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": {
    }
}&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;</description>
      <pubDate>Thu, 13 Jun 2024 21:10:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-colour-of-outline-or-fill-relating-to/m-p/1491902#M84859</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2024-06-13T21:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting colour of outline or fill relating to FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-colour-of-outline-or-fill-relating-to/m-p/1494158#M84889</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yea i did some minor magic with your sdk to make things work.&amp;nbsp;&lt;SPAN&gt;It makes no sense for it to be referencing the inherited parent class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;QOL recommendation the ESRI team updates the SDK to return the actual Renderer class being used by the layer. User can determine type using the type property that is inherited from Renderer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; export class FeatureLayer {
// code omitted for brevity
   /**
     * The renderer assigned to the layer.
     *
     * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer)
     */
    renderer: SimpleRenderer | UniqueValueRenderer | PieChartRenderer | HeatmapRenderer | ClassBreaksRenderer| DotDensityRenderer; // just grabbed a few
// code omitted for brevity
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at the SDK doesn't look like it would result in breaking changes, it would make it more flexible, and could actually help the ESRI team long term by simplifying some future refactors and feature developments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 04:45:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-colour-of-outline-or-fill-relating-to/m-p/1494158#M84889</guid>
      <dc:creator>Aeseir</dc:creator>
      <dc:date>2024-06-18T04:45:03Z</dc:date>
    </item>
  </channel>
</rss>

