<?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: Pass dynamic value to Feature Layer renderer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pass-dynamic-value-to-feature-layer-renderer/m-p/1094716#M74519</link>
    <description>&lt;P&gt;Ah thanks John. It worked once I added `angle` to the fields list that gets passed to the renderer (which I marked above as 'stuff'). Then added this to the renderer:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    visualVariables : [{
      type         : 'rotation',
      field        : 'angle',
      rotationType : 'geographic'
    }]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 22:09:34 GMT</pubDate>
    <dc:creator>RyanRundle</dc:creator>
    <dc:date>2021-09-01T22:09:34Z</dc:date>
    <item>
      <title>Pass dynamic value to Feature Layer renderer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pass-dynamic-value-to-feature-layer-renderer/m-p/1092339#M74410</link>
      <description>&lt;P&gt;Hi. A little newer to ArcGIS. I'm trying to render a simple marker via a feature layer renderer but pass a dynamic angle value. We have a number of different markers based on certain field values so we're using the `unique-value` type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Layer looks like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;          layerRef.current = new FeatureLayer({
            title         : stuff..
            id            : stuff..
            source        : graphics
            objectIdField : stuff..
            outFields     : stuff..
            fields        : stuff..
            renderer      : getHistoryByAssetRenderer(),
            popupTemplate : stuff..
          });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a dumb version of the array of the source objects:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const graphics = [
    {
        eventType : 'direction',
        angle     : 67
    },
    { 
        eventType : 'turning'
        angle.    : 234
    }
]&lt;/LI-CODE&gt;&lt;P&gt;then the renderer looks like so:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const getHistoryByAssetRenderer = () =&amp;gt; ({
    type          : 'unique-value',
    field         : 'eventType',
    uniqueValueInfos : [
        ...,
        {
            value  : 'direction',
            symbol : {
                type    : 'simple-marker',
                style   : 'path',
                path    : EVENT_TRIANGLE_PATH,
                angle   : HOW DO I GET PASS THE ANGLE HERE???
                size.   : 10
                color   : fillColor,
                outline : {
                    color : outlineColor,
                    width
                }
        }
    ]
})
       
        &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So of course the renderer handles finding the `eventType` field and rendering the marker based on the that field, but i'm not sure how to pass the angle to the symbol so the marker can be rotated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some notes on what I've tried:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if there is a way to use Roatation but it seems to balk when the renderer type is `unique-value`&lt;/P&gt;&lt;P&gt;Similar question:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-appstudio-questions/how-to-rotate-renderer-icon-graphic-dynamically/m-p/866574/highlight/true#M3172" target="_blank"&gt;https://community.esri.com/t5/arcgis-appstudio-questions/how-to-rotate-renderer-icon-graphic-dynamically/m-p/866574/highlight/true#M3172&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 17:42:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pass-dynamic-value-to-feature-layer-renderer/m-p/1092339#M74410</guid>
      <dc:creator>RyanRundle</dc:creator>
      <dc:date>2021-08-25T17:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pass dynamic value to Feature Layer renderer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pass-dynamic-value-to-feature-layer-renderer/m-p/1092726#M74429</link>
      <description>&lt;P&gt;Maybe try using a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html" target="_self"&gt;Rotation VisualVariable&lt;/A&gt; to do this task?&amp;nbsp; If it doesn't work for you, having a simple codepen (or similar) so we can see the code and experience the issue really helps.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:21:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pass-dynamic-value-to-feature-layer-renderer/m-p/1092726#M74429</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-08-26T15:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pass dynamic value to Feature Layer renderer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pass-dynamic-value-to-feature-layer-renderer/m-p/1094716#M74519</link>
      <description>&lt;P&gt;Ah thanks John. It worked once I added `angle` to the fields list that gets passed to the renderer (which I marked above as 'stuff'). Then added this to the renderer:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    visualVariables : [{
      type         : 'rotation',
      field        : 'angle',
      rotationType : 'geographic'
    }]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 22:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pass-dynamic-value-to-feature-layer-renderer/m-p/1094716#M74519</guid>
      <dc:creator>RyanRundle</dc:creator>
      <dc:date>2021-09-01T22:09:34Z</dc:date>
    </item>
  </channel>
</rss>

