Setting width of CIMSolidStroke via arcade has no effect in Maps SDK, but works in ArcGIS Pro

423
3
Jump to solution
11-27-2023 01:18 AM
radimbachb
New Contributor III

Dear ESRI community

I'm trying to change the width of a CIMSolidStroke via arcade script. According to the CIMSymbol documentation the CIMSolidStroke contains a width property (cim-spec/docs/v3/CIMSymbols.md at main · Esri/cim-spec · GitHub)

Following is a snippet of the symbol

 

"symbol": {
    "type": "CIMPolygonSymbol",
    "symbolLayers": [
        {
            "type": "CIMSolidStroke",
            "enable": true,
            "primitiveName": "pn_width_4",
            "capStyle": "Round",
            "joinStyle": "Round",
            "lineStyle3D": "Strip",
            "miterLimit": 10,
            "width": 0.3,
            "color": [
                0,
                0,
                0,
                255
            ]
        },
        {
            "type": "CIMSolidFill",
            "enable": true,
            "primitiveName": "pn_color_4",
            "color": [
                255,
                255,
                255,
                255
            ]
        }
    ],
    "angleAlignment": "Map"
}

 

Within the style's dictionary script I'd like to change the width of this CIMSolidStroke with following line

 

if (level == 'G' || level == 'H'){
    keys += keys + p1 + ';';
    keys += 'po:pn_4|Size|25' + ';';
    keys += 'po:pn_width_4|Width|6' + ';';
    keys += 'po:pn_color_4|Color|' + Yellow + ';';
}​

 

The end result in Qt Maps SDK looks like

radimbachb_0-1701076105164.png

As you can see, the 2 last symbols do change the size and color according to the arcade script, but not its CIMSolidStroke's Width.
Using the exact same style in ArcGIS Pro results in following symbols:

radimbachb_1-1701076324410.png

Here we can see that the CIMSolidStroke width is being changed according to the arcade script.

Is changing the CIMSolidStroke width via arcade simply not supported yet in the Maps SDK?

I attached some source files for an example QT project. It includes the sample.stylx file. Please put this file at <UserFolder>/ArcGIS/Runtime/Data/styles/sample.stylx.

0 Kudos
1 Solution

Accepted Solutions
GuillaumeBelz
Esri Contributor

Hello,

We confirm we can reproduce this problem. This will be fixed in the next release. There are not workaround for the moment.

Thank you

View solution in original post

0 Kudos
3 Replies
GuillaumeBelz
Esri Contributor

Hello radimbachb,

Can you provide the code to create the arcade script?

Which platform and version of SDK are you using?

Thank you

Guillaume Belz

0 Kudos
radimbachb
New Contributor III

Hi Guillaume

Thank you for the reply.

We use Qt 6.5.3, ArcGISQtSDK 200.2, running on Microsoft Windows 10 Enterprise Version 10.0.19044

The arcade script I edited directly within the `meta` table of the provided `sample.stylx` file.

Here is the full arcade script:

// Feature Fields
var keys;
var level = $feature.Field_1;
var volume = $feature.Field_2;
var code = $feature.Field_3;

// Symbols
var p1 = 'point_1';

// Colors
var Orange = '#FFA500';
var Lime =  '#00FF00';
var Red = '#FF0000';
var Yellow = '#FFFF00';

// See if text should be displayed.
var showLabels = $config.text != 'OFF';

if (level == 'A' || level == 'B'){
    keys += p1 + ';';
    keys += 'po:pn_1|Size|10' + ';';
    keys += 'po:pn_1|Rotation|45' +  ';';
    keys += 'po:pn_1|OffsetX|15' + ';';
    keys += 'po:pn_1|OffsetX|20' + ';';
    keys += 'po:pn_width_1|Width|3' + ';';
    keys += 'po:pn_color_1|Color|' + Orange + ';';
}
else if (level == 'C' || level == 'D'){
    keys += p1 + ';';
    keys += 'po:pn_2|Size|15' + ';';
    keys += 'po:pn_2|Rotation|90' + ';';
    keys += 'po:pn_width_2|Width|4' + ';';
    keys += 'po:pn_color_2|Color|' + Lime + ';';
}
else if (level == 'E' || level == 'F'){
    keys += p1 + ';';
    keys += 'po:pn_3|Size|20' + ';';
    keys += 'po:pn_3|Rotation|135' + ';';
    keys += 'po:pn_width_3|Width|5' + ';';
    keys += 'po:pn_color_3|Color|' + Red + ';';
}
else if (level == 'G' || level == 'H'){
    keys += p1 + ';';
    keys += 'po:pn_4|Size|25' + ';';
    keys += 'po:pn_width_4|Width|6' + ';';
    keys += 'po:pn_color_4|Color|' + Yellow + ';';
}
return keys;

 

0 Kudos
GuillaumeBelz
Esri Contributor

Hello,

We confirm we can reproduce this problem. This will be fixed in the next release. There are not workaround for the moment.

Thank you

0 Kudos