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)
Is it possible to add visual variables like Point3D width and depth, height for 2D pictures ? Maybe with CIMPictureMarker
Or an alternative?
Thanks!
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! 😊
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!
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!
I'm not able to override the scaleX property. This is no problem with size or rotation. scaleX just wont work
Codepen:
https://codepen.io/michaelk95/pen/zYzrYXK?editors=1000
used the ScaleX prop override for WIDTH and visualVariable for HEIGHT
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.
I'm not able to override the scaleX property. This is no problem with size or rotation. scaleX just wont work 😞
@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.