<?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: CIM Symbol doesn't update text color via CIMPrimitiveOverride in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1563684#M86164</link>
    <description>&lt;P&gt;Hi, sorry for the delayed response! Could you provide some more information on how the color attribute is stored in your layer? Is it a hex value or string rgb value?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2024 15:22:52 GMT</pubDate>
    <dc:creator>AnneFitz</dc:creator>
    <dc:date>2024-12-02T15:22:52Z</dc:date>
    <item>
      <title>CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1553237#M85987</link>
      <description>&lt;P&gt;I am defining a cimsymbol in the function with primitiveOverrides to update the style at runtime. This works fine for all border and background color, but for some reason it doesn't update the text color when i override the primitive (line 67). Am i missing something here? Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//https://esri.github.io/cim-symbol-builder-js/
export function getCIMSymbolData() {
  return {
    type: 'CIMSymbolReference',
    primitiveOverrides: [
      {
        type: 'CIMPrimitiveOverride',
        primitiveName: 'locationIndex',
        propertyName: 'TextString',
        valueExpressionInfo: {
          type: 'CIMExpressionInfo',
          expression: '$feature.text',
          returnType: 'Default',
        },
      },
      {
        type: 'CIMPrimitiveOverride',
        primitiveName: 'markerBackgroundColor',
        propertyName: 'Color',
        valueExpressionInfo: {
          type: 'CIMExpressionInfo',
          expression: '$feature.markerBackgroundColor',
          returnType: 'Default',
        },
      },
      {
        type: 'CIMPrimitiveOverride',
        primitiveName: 'markerTextAndBorderColor',
        propertyName: 'Color',
        valueExpressionInfo: {
          type: 'CIMExpressionInfo',
          expression: '$feature.markerTextAndBorderColor',
          returnType: 'Default',
        },
      },
    ],
    symbol: {
      type: 'CIMPointSymbol',
      symbolLayers: [
        {
          type: 'CIMVectorMarker',
          enable: true,
          size: 32,
          anchorPointUnits: 'Relative',
          frame: {
            xmin: -5,
            ymin: -5,
            xmax: 5,
            ymax: 5,
          },
          markerGraphics: [
            {
              type: 'CIMMarkerGraphic',
              primitiveName: 'locationIndex',
              geometry: {
                x: 0,
                y: 0,
              },
              symbol: {
                type: 'CIMTextSymbol',
                height: 4,
                horizontalAlignment: 'Center',
                offsetX: 0,
                offsetY: 5.5,
                symbol: {
                  type: 'CIMPolygonSymbol',
                  //todo find out why the text color is not getting overwritten
                  symbolLayers: [
                    {
                      type: 'CIMSolidFill',
                      primitiveName: 'markerTextAndBorderColor',
                      enable: true,
                      color: [0, 0, 0, 255],
                      //color: [255, 255, 255, 255],
                    },
                  ],
                },
                verticalAlignment: 'Center',
              },
              textString: '',
            },
          ],
          scaleSymbolsProportionally: true,
          respectFrame: true,
          anchorPoint: {
            x: 0,
            y: 0,
          },
          offsetY: 8,
        },
        {
          type: 'CIMVectorMarker',
          enable: true,
          anchorPoint: {
            x: 0,
            y: -0.5,
          },
          anchorPointUnits: 'Relative',
          dominantSizeAxis3D: 'Y',
          size: 40,
          billboardMode3D: 'FaceNearPlane',
          frame: {
            xmin: 0,
            ymin: 0,
            xmax: 21,
            ymax: 21,
          },
          scaleSymbolsProportionally: true,
          respectFrame: true,
          markerGraphics: [
            {
              type: 'CIMMarkerGraphic',
              geometry: {
                rings: [
                  [
                    [17.17, 14.33],
                    [16.97, 12.96],
                    [16.38, 11.37],
                    [12.16, 3.98],
                    [11.2, 1.94],
                    [10.5, 0],
                    [9.8, 1.96],
                    [8.84, 4.02],
                    [4.61, 11.41],
                    [4.02, 12.98],
                    [3.83, 14.33],
                    [3.96, 15.63],
                    [4.34, 16.88],
                    [4.95, 18.03],
                    [5.78, 19.04],
                    [6.8, 19.88],
                    [7.95, 20.49],
                    [9.2, 20.87],
                    [10.5, 21],
                    [11.8, 20.87],
                    [13.05, 20.5],
                    [14.2, 19.88],
                    [15.22, 19.05],
                    [16.05, 18.03],
                    [16.66, 16.88],
                    [17.04, 15.63],
                    [17.17, 14.33],
                  ],
                ],
              },
              symbol: {
                type: 'CIMPolygonSymbol',
                symbolLayers: [
                  {
                    type: 'CIMSolidStroke',
                    primitiveName: 'markerTextAndBorderColor',
                    enable: true,
                    capStyle: 'Round',
                    joinStyle: 'Round',
                    lineStyle3D: 'Strip',
                    miterLimit: 10,
                    width: 0.5,
                    color: 'black',
                  },
                  {
                    type: 'CIMSolidFill',
                    primitiveName: 'markerBackgroundColor',
                    enable: true,
                    color: '#c1dba3',
                  },
                ],
              },
            },
          ],
        },
      ],
    },
  };
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 13:03:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1553237#M85987</guid>
      <dc:creator>Jonas1</dc:creator>
      <dc:date>2024-10-29T13:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1553803#M85998</link>
      <description>&lt;P&gt;I believe we've fixed this bug for the upcoming release (version 4.31) coming soon! Can you try out the /next development version of the API and let me know if this fixes your issue?&amp;nbsp;&lt;/P&gt;
&lt;PRE class="notranslate"&gt;&lt;CODE&gt;&amp;lt;script src="https://js.arcgis.com/next/"&amp;gt;&amp;lt;/script&amp;gt;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 15:42:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1553803#M85998</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2024-10-30T15:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1557408#M86057</link>
      <description>&lt;P&gt;The issue still persists using the 4.31 or&amp;nbsp;&lt;A href="https://www.npmjs.com/package/@arcgis/core/v/4.32.0-next.20241111" target="_blank" rel="noopener"&gt;4.32.0-next.20241111&lt;/A&gt;&amp;nbsp;version. If you need more information about how i am using it please let me know. This is the FeatureLayer that uses the cimsymbol:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;new FeatureLayer({
          id: id,
          objectIdField: 'featureId',
          fields: [
            { name: 'graphicId', type: 'string' },
            { name: 'featureName', type: 'string' },
            { name: 'text', type: 'integer' },
            { name: 'markerBackgroundColor', type: 'string' },
            { name: 'markerTextAndBorderColor', type: 'string' },
          ],
          outFields: ['*'],
          title: id,
          source: graphicList,
          renderer: {
            type: 'simple',
            symbol: {
              type: 'cim',
              data: getCIMSymbolData(),
            },
          } as __esri.RendererProperties,
          geometryType: 'point',
          spatialReference: {
            wkid: 102100,
          },
        }),&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 09:06:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1557408#M86057</guid>
      <dc:creator>Jonas1</dc:creator>
      <dc:date>2024-11-12T09:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1563684#M86164</link>
      <description>&lt;P&gt;Hi, sorry for the delayed response! Could you provide some more information on how the color attribute is stored in your layer? Is it a hex value or string rgb value?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 15:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1563684#M86164</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2024-12-02T15:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1563996#M86169</link>
      <description>&lt;P&gt;Hey, we tried both using the rgb array and also using hex, but since it was working fine using hex for the border our logic should be working fine.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.hitTestFeatureLayer().applyEdits({
        updateFeatures: graphics.map((graphic) =&amp;gt; {
          if (graphic.attributes['graphicId'] === customerLocationUuid) {
            graphic.attributes['markerBackgroundColor'] = '#558817';
            graphic.attributes['markerTextAndBorderColor'] = [255, 255, 255, 1]; //'#ffffff'
          } else {
            graphic.attributes['markerBackgroundColor'] = '#c1dba3';
            graphic.attributes['markerTextAndBorderColor'] = '#000000';
          }
          return graphic;
        }),
      });&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Dec 2024 08:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1563996#M86169</guid>
      <dc:creator>Jonas1</dc:creator>
      <dc:date>2024-12-03T08:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564067#M86174</link>
      <description>&lt;P&gt;Yes, hex values should work! I just tried out your symbol with a client-side feature layer and the overrides appear to be working as expected.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-12-03 at 9.34.27 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/120729i409E9478C3A52918/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-12-03 at 9.34.27 AM.png" alt="Screenshot 2024-12-03 at 9.34.27 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://codepen.io/annefitz/pen/wBwKgpM?editors=1000" target="_blank"&gt;https://codepen.io/annefitz/pen/wBwKgpM?editors=1000&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Let me know if you see something different and these overrides are not working for you! Otherwise, I think there may be an issue elsewhere in your code and it might be worth reaching out to tech support for help.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 14:35:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564067#M86174</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2024-12-03T14:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564083#M86175</link>
      <description>&lt;P&gt;Oh i am sorry, i forgot to mention that setting it initially works, but our case is updating the overwrite after the graphic has been created, which works fine for the border, but not for the text.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 14:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564083#M86175</guid>
      <dc:creator>Jonas1</dc:creator>
      <dc:date>2024-12-03T14:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564245#M86179</link>
      <description>&lt;P&gt;Oh thanks for the clarification! Just tested this out though by performing a hitTest &amp;amp; applyEdits when the feature is clicked and both the background, text, and border colors all seem to be updating as expected. Here's my example (click on a feature to update the attributes &amp;amp; watch it change color):&amp;nbsp;&lt;A href="https://codepen.io/annefitz/pen/OPLyxRw" target="_blank"&gt;https://codepen.io/annefitz/pen/OPLyxRw&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 18:52:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564245#M86179</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2024-12-03T18:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564276#M86180</link>
      <description>&lt;P&gt;Thanks for the demo. I guess there is something wierd happening in our application then, will try to find the problem.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 19:25:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1564276#M86180</guid>
      <dc:creator>Jonas1</dc:creator>
      <dc:date>2024-12-03T19:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1565096#M86197</link>
      <description>&lt;P&gt;I found that it is working in 2D and CIMPolygonSymbol is not supported yet in 3D. And also for some reason it only doesn't work for the text, but we are using the CIMPolygonSymbol for the background color also and that works...&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 13:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1565096#M86197</guid>
      <dc:creator>Jonas1</dc:creator>
      <dc:date>2024-12-05T13:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: CIM Symbol doesn't update text color via CIMPrimitiveOverride</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1565188#M86198</link>
      <description>&lt;P&gt;Ok, this seems like a bug - we'll take another look. Thanks for letting us know!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 16:20:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cim-symbol-doesn-t-update-text-color-via/m-p/1565188#M86198</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2024-12-05T16:20:52Z</dc:date>
    </item>
  </channel>
</rss>

