JS API 4.17 sketch widget PictureFillSymbol

967
5
10-20-2020 08:04 AM
johnbrosowsky
Occasional Contributor II

Drawing a rectangle with the JS API sketch widget, it is possible to make a PictureFillSymbol for a sketched rectangle stretch to 100% of the drawn rectangle width and height, including when moved, rotated, and scaled? 

Thanks!

JB

0 Kudos
5 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

It should behave just the way you said. Please let me know if you are running into issues. 

Check out this test app for how it should work. Create a rectangle and you should see picturefillsymbol scaling, resizing and rotating as expected.

-Undral

0 Kudos
johnbrosowsky
Occasional Contributor II

Hi Undral - 

Running your example, the picturefillsymbol does not stretch to fill the sketched geometry, and does not scale or rotate as the sketch graphic is edited.  It always says the same rotation and scale, and repeats to fill the extent of the geometry. 

0 Kudos
UndralBatsukh
Esri Regular Contributor

Can you please clarify the behavior you are describing?  Here is what I see. 

0 Kudos
johnbrosowsky
Occasional Contributor II

Hi Undral - 

Yes I see what you see.  Your background image of a single black star is not stretching to fill the the extent of the sketched graphic, is not rotating as as the sketched graphic is rotated, and does not scale as the sketched graphic is scaled. 

I am looking to see if I can use the sketch features to bring in a scanned map, allow the the user to translate, rotate, and scale it into place, and then for example use some other tools to digitize features from the scanned map.  

Similar to this awesome example from Dakota County MN, https://www.arcgis.com/home/item.html?id=68f3890767a843c0940eb7e9840c5244  only using the new JS API, no WAB, and no third party libs for interactive shape control on the display.    

Thanks!

JB

0 Kudos
UndralBatsukh
Esri Regular Contributor

It is working as designed.

It wont fill the extent of the polygon. It will fill the shape of the polygon.

Rotation is working as designed.  Stars wont scale (wont get smaller or bigger). The fillSymbol will always fill the polygon you are creating. 

0 Kudos