<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Draw widget custom symbols in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1044654#M14472</link>
    <description>&lt;P&gt;Wow! That's an excellent and very thorough resource. Make sure you mark your own answer as "accepted" so that this is easier for others to find.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Apr 2021 15:16:50 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-04-07T15:16:50Z</dc:date>
    <item>
      <title>Draw widget custom symbols</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1041996#M14463</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use custom symbols in place of the pre-defined point symbols.&lt;/P&gt;&lt;P&gt;I found &lt;STRONG&gt;&amp;lt;install directory&amp;gt;\client\stemapp\jimu.js\dijit\SymbolsInfo &lt;/STRONG&gt;which contains *.json files that correspond to the default point symbols. But when I modify or delete these files, it has no effect on my app. I have tried refreshing the content by going back to home and creating a new app as that was the only way I could get some other edits to show, but that doesn't help here.&lt;/P&gt;&lt;P&gt;I seem to be missing something. Any thoughts?&lt;/P&gt;&lt;P&gt;If it matters, I am looking to have these custom point symbols be used in the eDraw widget, but I have been testing on both eDraw the the standard Draw widgets.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 16:25:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1041996#M14463</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2021-03-30T16:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Draw widget custom symbols</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1044627#M14470</link>
      <description>&lt;P&gt;When you "publish" the app, it copies all the relevant files to a new folder. Try looking in &lt;STRONG&gt;&amp;lt;exported-app-folder&amp;gt;\jimu.js\dijit\SymbolsInfo &lt;/STRONG&gt;and editing those, as they will be the files referenced in the exported web app.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 14:19:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1044627#M14470</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-04-07T14:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Draw widget custom symbols</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1044652#M14471</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Hi Josh, Thank you for the reply!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;I actually just got this working. I tried changing details in both the client and the server directories, but nothing was working. What I did that seemed to fix everything was I edited &lt;STRONG&gt;SymbolChooser.js&lt;/STRONG&gt; and changed DEFAULT_PORTAL_URL from //arcgis.com/ to our portal, and _isOnline from true to false. After this, all the changes I made appeared and things have been working well since.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;In case anyone else stumbles across this, here are all the changes I made to get custom images to appear in the draw widget (*see very end for server vs. client):&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;1. Navigate to &lt;FONT face="courier new,courier"&gt;&amp;lt;InstallDirectory&amp;gt;\&lt;U&gt;client&lt;/U&gt;\stemapp\jimu.js\dijit\SymbolChooser.js&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Change &lt;FONT face="courier new,courier"&gt;DEFAULT_PORTAL_URL &lt;/FONT&gt;from &lt;FONT face="courier new,courier"&gt;//arcgis.com/&lt;/FONT&gt; to&lt;FONT face="courier new,courier"&gt; //DNS.domain.com/&lt;/FONT&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Change &lt;FONT face="courier new,courier"&gt;_isOnline&lt;/FONT&gt; from &lt;FONT face="courier new,courier"&gt;true&lt;/FONT&gt; to &lt;FONT face="courier new,courier"&gt;false&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;2. Navigate to &lt;FONT face="courier new,courier"&gt;&amp;lt;InstallDirectory&amp;gt;\&lt;U&gt;client&lt;/U&gt;\stemapp\jimu.js\dijit\templates\SymbolChooser.html&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Locate &lt;FONT face="courier new,courier"&gt;&amp;lt;select data-dojo-attach-point="pointSymClassSelect" data-dojo-type="dijit/form/Select" style="width:100%;height:30px;"&amp;gt;&amp;lt;/select&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Add the text you want to appear in the drop-down between these two tags. E.g., &lt;FONT face="courier new,courier"&gt;&amp;lt;option value='20'selected="selected"&amp;gt;Company Custom Option 1&amp;lt;/option&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;3. Navigate to &lt;FONT face="courier new,courier"&gt;&amp;lt;InstallDirectory&amp;gt;\&lt;U&gt;client&lt;/U&gt;\stemapp\jimu.js\dijit\SymbolsInfo&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Add a &lt;FONT face="courier new,courier"&gt;*.json&lt;/FONT&gt;. I copy-pasted one already there and named it &lt;FONT face="courier new,courier"&gt;20.json&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Format generally looks like this (you can inspect the other &lt;FONT face="courier new,courier"&gt;*.json&lt;/FONT&gt; files):&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
{
"imageData":"xxx",
"height":100,
"width":100,
"xoffset":22,
"yoffset":22,
"name":"YourImageName",
"type":"esriPMS",
"angle":0,
"url":"jimu.js/dijit/images/Your_Image.png",
"contentType":"image/png"
}
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;A couple notes:&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;FONT size="3"&gt;Offset is your mouse offset&lt;/FONT&gt; from the image centre. You will have to play with this to get it correct&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I stuck with my image height/width (100x100), but I didn't find modifying this did anything noticeable&amp;nbsp;in my testing&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Name can be anything you want. In my testing, it apparently didn't need to be unique but I made it unique anyways&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;URL can be a directory within your app (see Step 4) or a location on the web&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The imageData line is necessary&amp;nbsp;if you want to print your images. Without it, the custom images will not appear on the printed document. Where "xxx" is, should be a long alpha string. Edit: See my post below for how to generate this.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;4. Navigate to &lt;FONT face="courier new,courier"&gt;&amp;lt;InstallDirectory&amp;gt;\&lt;U&gt;client&lt;/U&gt;\stemapp\jimu.js\dijit&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Create a folder called "Images"&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Put images you want to use into this folder. A *.png with a clear background would be best&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;5. Edit: Didn't find this out until I published. I added this last step to get it to work on Portal&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Once you publish to your portal, the &lt;EM&gt;SymbolChooser.js&lt;/EM&gt; file will ignore the above customization and pull the list of points (as well as their associated properties) from a separate online source. You need to override this functionality to get the custom symbols to appear.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I discussed this in a different thread:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-web-appbuilder-questions/draw-widget-custom-list-reverting-to-esri-default-once-published/m-p/1046049/thread-id/20638#M20655" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-web-appbuilder-questions/draw-widget-custom-list-reverting-to-esri-default-once-published/m-p/1046049/thread-id/20638#M20655&lt;/A&gt;. I will also post those steps here to avoid people needlessly searching the forms:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Go into &lt;FONT face="courier new,courier"&gt;&lt;EM&gt;SymbolChooser.js&lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Look around line 548** for&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if(!this._symbolTypes){&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;and modify as I have below:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;if(!this._symbolTypes){&lt;BR /&gt;// // fetch symbol types from portal&lt;BR /&gt;// this._initPortal()&lt;BR /&gt;//Added this line:&lt;BR /&gt;this._offLineGetSymbols(fileName);&lt;BR /&gt;// .then(lang.hitch(this, this._fetchSymbolTypes))&lt;BR /&gt;// .then(lang.hitch(this, function(types){&lt;BR /&gt;// if(!this.domNode){&lt;BR /&gt;// return;&lt;BR /&gt;// }&lt;BR /&gt;// // create options&lt;BR /&gt;// this._clearOptions();&lt;BR /&gt;// this._createOptions(types);&lt;BR /&gt;// // fetch symbols from portal&lt;BR /&gt;// this._handleGetPointSymbols(lang.hitch(this, this._getPortalSymbolsByType), fileName);&lt;BR /&gt;// }), lang.hitch(this, function(err){&lt;BR /&gt;// if(!this.domNode){&lt;BR /&gt;// return;&lt;BR /&gt;// }&lt;BR /&gt;// if(window.isXT){&lt;BR /&gt;// this._offLineGetSymbols(fileName);&lt;BR /&gt;// }else{&lt;BR /&gt;// this.loadingShelter.hide();&lt;BR /&gt;// console.error('Fetching symbols failed', err);&lt;BR /&gt;// }&lt;BR /&gt;// }));&lt;BR /&gt;&lt;BR /&gt;}else{&lt;BR /&gt;// // fetch symbols from portal&lt;BR /&gt;this._handleGetPointSymbols(lang.hitch(this, this._getPortalSymbolsByType), fileName);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;},&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;*As Josh mentioned, if you want to make these changes in an app that has already been created, you need to navigate to &lt;FONT face="courier new,courier"&gt;&amp;lt;InstallDirectory&amp;gt;\&lt;U&gt;server&lt;/U&gt;\apps\###&lt;/FONT&gt;&lt;BR /&gt;Where ### is the automatically generated number of your app.&lt;BR /&gt;The same steps mentioned above still apply.&lt;BR /&gt;Where you make these changes (either client or server) is up to you and your needs. I learned/tested in &lt;EM&gt;server&lt;/EM&gt; and then replicated the changes in &lt;EM&gt;client&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;** You should be using something like Notepad++ or Visual Studio Code (both free) to do this.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:22:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1044652#M14471</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2021-04-14T21:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Draw widget custom symbols</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1044654#M14472</link>
      <description>&lt;P&gt;Wow! That's an excellent and very thorough resource. Make sure you mark your own answer as "accepted" so that this is easier for others to find.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:16:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1044654#M14472</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-04-07T15:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Draw widget custom symbols</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1046054#M14473</link>
      <description>&lt;P&gt;As an update to my last post, to get "ImageData", you can use an online tool that converts a PNG into data uri such as &lt;A href="https://onlinepngtools.com/convert-png-to-data-uri" target="_blank"&gt;https://onlinepngtools.com/convert-png-to-data-uri&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 19:34:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/draw-widget-custom-symbols/m-p/1046054#M14473</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2021-04-12T19:34:26Z</dc:date>
    </item>
  </channel>
</rss>

