Select to view content in your preferred language

REAL SIZE 2D markers

5785
10
08-06-2021 07:19 AM
MichaelK1
Emerging Contributor

Want to create a feature layer with a picture renderer but I want to stretch the image based on real size.  Adding a height and width for a specific image.

For example this image with the correct width and height (width and height are present in the graphics attributes)

real size.png

 


Is it possible to add visual variables like Point3D width and depth, height for 2D pictures ? Maybe with CIMPictureMarker

Or an alternative?

Thanks!

 

 

 

 

0 Kudos
10 Replies
AnneFitz
Esri Regular Contributor

Hey Michael - yes this is possible with CIM symbols! You can use primitiveOverrides to updates specific properties of a symbol layer, like width and height. See this example for more information on how to use primitiveOverrides. For CIMPictureMarker , you would want to override the "size" property, which will update the height of the marker. The width will be updated proportionally. Don't hesitate to reach out if you have any questions! 😊

0 Kudos
MichaelK1
Emerging Contributor

Yes Thanks, but is it possible to NOT update width proportionally. And override height and width property separately for CIMPictureMarker or other 2D picture based markers?

Thanks!

0 Kudos
AnneFitz
Esri Regular Contributor

I think this is possible, if I’m correctly understanding what you’re asking. You could use the size property to update the height of the picture marker symbol, and then use the scaleX property to override the width of the symbol layer. I haven’t tried this out personally, but I think it should work. Let me know how it goes!

0 Kudos
PoaBVG
by
New Contributor

I'm not able to override the scaleX property. This is no problem with size or rotation. scaleX just wont work 

 

0 Kudos
AnneFitz
Esri Regular Contributor
Can you share a codepen or something?
0 Kudos
MichaelK1
Emerging Contributor
0 Kudos
AnneFitz
Esri Regular Contributor

Thanks - it looks like we might have a bug with primitiveOverrides and the CIMPictureMarker symbol layer. We'll look into it and I'll get back to you as soon as we have a fix.

PoaBVG
by
New Contributor

I'm not able to override the scaleX property. This is no problem with size or rotation. scaleX just wont work 😞

0 Kudos
AnneFitz
Esri Regular Contributor

@MichaelK1 and @PoaBVG , this bug has been fixed for version 4.21, which will be released in a couple weeks. If you want to test out the fix before it is officially released, you can use the `/next` version of the API: https://js.arcgis.com/next/

@MichaelK1 - here is the sample you sent with the primitiveOverride for scaleX now working: https://codepen.io/annefitz/pen/zYzqmyJ

Let me know if you have any further questions! Thanks.

0 Kudos