How do I add a hatch pattern to the Draw widget?

1671
11
11-14-2016 03:04 PM
MichaelAugust
Occasional Contributor III

hatch draw widget

How would I add a that simple backwards black line hatch pattern to the Draw widget? What JS would I have to add where? I'm hoping someone has tried this and could provide feedback/experience.  Thanks!

0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus

Michael,

   It is not so simple. You will have to replace the jimu.js/dijit/SymbolChooser.js and jimu.js/dijit/templates/SymbolChooser.html as well as add the new style to the jimu.js/dijit/SymbolsInfo/fill.json:

For the jimu.js/dijit/SymbolsInfo/fill.json part (be careful to add this without causing a syntax error, add it at the end of the file just before the ] 😞

,{"tags":["black","hash"],"title":"Hash","style":"esriSFSBackwardDiagonal","color":[0,0,0,255],"name":"Hash","type":"esriSFS","outline":{"style":"esriSLSSolid","color":[0,0,0,255],"width":1.5,"type":"esriSLS"}}

Replace the jimu.js/dijit/SymbolChooser.js and jimu.js/dijit/templates/SymbolChooser.html using the attached files

MichaelAugust
Occasional Contributor III

Awesome - thanks Robert! Now what if I made it really tricky and wanted to add the default balloon callout style, the standard arcmap yellow callout, to the text drawing tool (A) in the draw widget, would it be a similar process? We're trying to modify this particular widget so that our users can create a common vicinity map that we utilize. Our regular Arcmap template has a standard symbology, i.e. the site boundary hatch and a simple balloon text callout which points to the hatched area...does the text styling work in a similar way? Thanks again for your help!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Michael,


   I am not sure that is possible at all.

0 Kudos
deleted-user-CQZbjNeBXm49
Occasional Contributor III

Hi Robert,

Please can you help me out, as I have tried on my own to replicate your modifications to the SymbolChooser js and html but to no success for the WAB 2.3 version?.

Thank you

Baba

0 Kudos
deleted-user-CQZbjNeBXm49
Occasional Contributor III

No need anymore Robert, I have fixed it and it works perfect now.....

Thanks

Baba

Gedeon_muhawenayo
New Contributor II

Hi @RobertScheitlin__GISP , 
Thanks very much for a very supportive reply.
I would like to ask how to do this with the recent releases, because when I replaced my jimu.js/dijit/SymbolChooser.js and jimu.js/dijit/templates/SymbolChooser.html with the files you share I lost some functionalities. If you could share with me the updated files or the lines of code to modify.

Best.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

@Gedeon_muhawenayo  That code was from 6 years ago. So much has changed. What version of WAB are you using?

Gedeon_muhawenayo
New Contributor II

Hi @RobertScheitlin__GISP , I am using the WAB Version 2.24

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

@Gedeon_muhawenayo 

Here is the 2.24 version of the zip file above.