CIMGeometricEffectOffset not working in JS

1060
5
Jump to solution
04-20-2021 10:24 AM
martip23
New Contributor II

The below is my code which creates a line, I want to see it offset a certain distance. It works in the legend but it results in the line ultimately not drawing in the map itself.

                            {
                                type: 'CIMSolidStroke',
                                effects: [{
                                    type: 'CIMGeometricEffectOffset',
                                    method: 'Rounded',
                                    option: 'Fast',
                                    offset: 3.0
                                }],
                                enable: true,
                                capStyle: 'Butt',
                                joinStyle: 'Round',
                                width: 3,
                                color: [
                                    56,
                                    168,
                                    0,
                                    255
                                ]
                            },

 Is this method supported? 

0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Hi @martip23 - yes, this method is supported! Here is an example using the same symbol layer you mentioned above: https://codepen.io/annefitz/pen/eYgPMWP?editors=1000

The green stroke symbol layer is offset by 3 and the red stroke symbol layer has no offset applied. Let me know if you have further questions!

View solution in original post

5 Replies
AnneFitz
Esri Regular Contributor

Hi @martip23 - yes, this method is supported! Here is an example using the same symbol layer you mentioned above: https://codepen.io/annefitz/pen/eYgPMWP?editors=1000

The green stroke symbol layer is offset by 3 and the red stroke symbol layer has no offset applied. Let me know if you have further questions!

martip23
New Contributor II

Thank you! I got it to work now, it seems to take at least 2 minutes to load, and sometimes it generates incorrectly. I think I have too many polylines to get this to offset efficiently.

 

0 Kudos
AnneFitz
Esri Regular Contributor

Interesting, I haven't seen performance issues with this in the past. Would you be willing to share your app with me? You can email me at afitz@esri.com if you don't want to share it publicly here. Thank you!

0 Kudos
martip23
New Contributor II

I sent some information via email. I should also state, that sometimes when it does load, and loads buggy (Only sections of one or two of the hundreds of lines loads), it fixes itself when I zoom out completely, and zoom back into the map.

 

0 Kudos
martip23
New Contributor II

Note that when I remove the offset effect, the lines load instantly.

 

0 Kudos