<?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 Replacing an CIMPictureMarker color with an attribute in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/replacing-an-cimpicturemarker-color-with-an/m-p/1571153#M86292</link>
    <description>&lt;P&gt;I am looking to do a feature layer which I have set up with a renderer with a CIM Symbol.&amp;nbsp; I want to change the color of the&lt;SPAN&gt;CIMPictureMarker&lt;/SPAN&gt; based on an attribute of the feature. My current code doesnt let me change the color. Is this the best renderer to use? I did not use a unique value renderer since I dont need to compare the value I want to use. I am also curious if I can rework&amp;nbsp;&lt;SPAN&gt;valueExpressionInfo to call a function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;{&lt;BR /&gt;    &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;"simple"&lt;/SPAN&gt;,&lt;BR /&gt;        &lt;SPAN&gt;symbol&lt;/SPAN&gt;: &lt;SPAN&gt;new &lt;/SPAN&gt;CIMSymbol({&lt;BR /&gt;        &lt;SPAN&gt;data&lt;/SPAN&gt;: {&lt;BR /&gt;            &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMSymbolReference'&lt;/SPAN&gt;,&lt;BR /&gt;            &lt;SPAN&gt;primitiveOverrides&lt;/SPAN&gt;: [&lt;BR /&gt;                {&lt;BR /&gt;                    &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMPrimitiveOverride'&lt;/SPAN&gt;,&lt;BR /&gt;                    &lt;SPAN&gt;primitiveName&lt;/SPAN&gt;: &lt;SPAN&gt;'imageMarker'&lt;/SPAN&gt;,&lt;BR /&gt;                    &lt;SPAN&gt;propertyName&lt;/SPAN&gt;: &lt;SPAN&gt;'replacementColor'&lt;/SPAN&gt;,&lt;BR /&gt;                    &lt;SPAN&gt;valueExpressionInfo&lt;/SPAN&gt;: {&lt;BR /&gt;                        &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMExpressionInfo'&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;expression&lt;/SPAN&gt;: &lt;SPAN&gt;'$feature.statusColor'&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;returnType&lt;/SPAN&gt;: &lt;SPAN&gt;'Default'&lt;/SPAN&gt;,&lt;BR /&gt;                    },&lt;BR /&gt;                }&lt;BR /&gt;            ],&lt;BR /&gt;            &lt;SPAN&gt;symbol&lt;/SPAN&gt;: {&lt;BR /&gt;                &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMPointSymbol'&lt;/SPAN&gt;,&lt;BR /&gt;                &lt;SPAN&gt;primativeName&lt;/SPAN&gt;: &lt;SPAN&gt;"imageMarker"&lt;/SPAN&gt;,&lt;BR /&gt;                &lt;SPAN&gt;symbolLayers&lt;/SPAN&gt;: [&lt;BR /&gt;                    {&lt;BR /&gt;                        &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;"CIMPictureMarker"&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;enable&lt;/SPAN&gt;: &lt;SPAN&gt;true&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;size&lt;/SPAN&gt;: &lt;SPAN&gt;20&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;scaleX&lt;/SPAN&gt;: &lt;SPAN&gt;1&lt;/SPAN&gt;,&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;colorSubstitutions&lt;/SPAN&gt;: [&lt;BR /&gt;    {&lt;BR /&gt;        &lt;SPAN&gt;targetColor&lt;/SPAN&gt;: [&lt;SPAN&gt;255&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;255&lt;/SPAN&gt;], &lt;SPAN&gt;// red&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;replacementColor&lt;/SPAN&gt;: [&lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;255&lt;/SPAN&gt;, &lt;SPAN&gt;255&lt;/SPAN&gt;] &lt;SPAN&gt;// blue&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;]&lt;/PRE&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;: &lt;SPAN&gt;"https:////myCnd/images/defaultImage.png"&lt;BR /&gt;&lt;/SPAN&gt; },&lt;BR /&gt;],&lt;BR /&gt;},&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;}&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 24 Dec 2024 14:41:40 GMT</pubDate>
    <dc:creator>ChaosSteve</dc:creator>
    <dc:date>2024-12-24T14:41:40Z</dc:date>
    <item>
      <title>Replacing an CIMPictureMarker color with an attribute</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/replacing-an-cimpicturemarker-color-with-an/m-p/1571153#M86292</link>
      <description>&lt;P&gt;I am looking to do a feature layer which I have set up with a renderer with a CIM Symbol.&amp;nbsp; I want to change the color of the&lt;SPAN&gt;CIMPictureMarker&lt;/SPAN&gt; based on an attribute of the feature. My current code doesnt let me change the color. Is this the best renderer to use? I did not use a unique value renderer since I dont need to compare the value I want to use. I am also curious if I can rework&amp;nbsp;&lt;SPAN&gt;valueExpressionInfo to call a function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;{&lt;BR /&gt;    &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;"simple"&lt;/SPAN&gt;,&lt;BR /&gt;        &lt;SPAN&gt;symbol&lt;/SPAN&gt;: &lt;SPAN&gt;new &lt;/SPAN&gt;CIMSymbol({&lt;BR /&gt;        &lt;SPAN&gt;data&lt;/SPAN&gt;: {&lt;BR /&gt;            &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMSymbolReference'&lt;/SPAN&gt;,&lt;BR /&gt;            &lt;SPAN&gt;primitiveOverrides&lt;/SPAN&gt;: [&lt;BR /&gt;                {&lt;BR /&gt;                    &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMPrimitiveOverride'&lt;/SPAN&gt;,&lt;BR /&gt;                    &lt;SPAN&gt;primitiveName&lt;/SPAN&gt;: &lt;SPAN&gt;'imageMarker'&lt;/SPAN&gt;,&lt;BR /&gt;                    &lt;SPAN&gt;propertyName&lt;/SPAN&gt;: &lt;SPAN&gt;'replacementColor'&lt;/SPAN&gt;,&lt;BR /&gt;                    &lt;SPAN&gt;valueExpressionInfo&lt;/SPAN&gt;: {&lt;BR /&gt;                        &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMExpressionInfo'&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;expression&lt;/SPAN&gt;: &lt;SPAN&gt;'$feature.statusColor'&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;returnType&lt;/SPAN&gt;: &lt;SPAN&gt;'Default'&lt;/SPAN&gt;,&lt;BR /&gt;                    },&lt;BR /&gt;                }&lt;BR /&gt;            ],&lt;BR /&gt;            &lt;SPAN&gt;symbol&lt;/SPAN&gt;: {&lt;BR /&gt;                &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;'CIMPointSymbol'&lt;/SPAN&gt;,&lt;BR /&gt;                &lt;SPAN&gt;primativeName&lt;/SPAN&gt;: &lt;SPAN&gt;"imageMarker"&lt;/SPAN&gt;,&lt;BR /&gt;                &lt;SPAN&gt;symbolLayers&lt;/SPAN&gt;: [&lt;BR /&gt;                    {&lt;BR /&gt;                        &lt;SPAN&gt;type&lt;/SPAN&gt;: &lt;SPAN&gt;"CIMPictureMarker"&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;enable&lt;/SPAN&gt;: &lt;SPAN&gt;true&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;size&lt;/SPAN&gt;: &lt;SPAN&gt;20&lt;/SPAN&gt;,&lt;BR /&gt;                        &lt;SPAN&gt;scaleX&lt;/SPAN&gt;: &lt;SPAN&gt;1&lt;/SPAN&gt;,&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;colorSubstitutions&lt;/SPAN&gt;: [&lt;BR /&gt;    {&lt;BR /&gt;        &lt;SPAN&gt;targetColor&lt;/SPAN&gt;: [&lt;SPAN&gt;255&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;255&lt;/SPAN&gt;], &lt;SPAN&gt;// red&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;replacementColor&lt;/SPAN&gt;: [&lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;255&lt;/SPAN&gt;, &lt;SPAN&gt;255&lt;/SPAN&gt;] &lt;SPAN&gt;// blue&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;]&lt;/PRE&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;: &lt;SPAN&gt;"https:////myCnd/images/defaultImage.png"&lt;BR /&gt;&lt;/SPAN&gt; },&lt;BR /&gt;],&lt;BR /&gt;},&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;}&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Dec 2024 14:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/replacing-an-cimpicturemarker-color-with-an/m-p/1571153#M86292</guid>
      <dc:creator>ChaosSteve</dc:creator>
      <dc:date>2024-12-24T14:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing an CIMPictureMarker color with an attribute</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/replacing-an-cimpicturemarker-color-with-an/m-p/1571700#M86298</link>
      <description>&lt;P&gt;Hi! Based on your code snippet above, it looks like you have a color stored as the attribute value. Instead of overriding the colorSubstitution value (which is not supported), try overriding the CIMPictureMarker tintColor property. Here's an example:&amp;nbsp;&lt;A href="https://codepen.io/annefitz/pen/wBwrooy" target="_blank"&gt;https://codepen.io/annefitz/pen/wBwrooy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Note that the primitiveName on the override must match the primitiveName on the symbol layer with the property you are trying to override.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 16:28:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/replacing-an-cimpicturemarker-color-with-an/m-p/1571700#M86298</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2024-12-30T16:28:26Z</dc:date>
    </item>
  </channel>
</rss>

