Select to view content in your preferred language

Change Default Advanced Print Widget Settings

3463
7
Jump to solution
06-06-2019 11:52 AM
mpboyle
Frequent Contributor

Is it possible to change some of the default Print widget Advanced settings within Web AppBuilder developer edition?

For example, the default map scale unit is "Miles" ... I'd like it to be "Feet", so every time one of our users wants to use the widget, they have to remember to go through the Advanced settings.

Just curious if there's a javascript or config file somewhere where this can be changed?

1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Matthew,

   In the Print/templates/Print.html Make this change:

<td>
  <select data-dojo-type="dijit/form/Select" data-dojo-props="name:'scalebarUnit',style:'width:100%;'"
                        data-dojo-attach-point="scalebarUnitDijit">
    <option value="Miles">${nls.unitsMiles}</option>
    <option value="Kilometers">${nls.unitsKilometers}</option>
    <option value="Meters">${nls.unitsMeters}</option>
    <option value="Feet" selected="selected">${nls.unitsFeet}</option>
  </select>
</td>‍‍‍‍‍‍‍‍‍

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Emeritus

Matthew,

   In the Print/templates/Print.html Make this change:

<td>
  <select data-dojo-type="dijit/form/Select" data-dojo-props="name:'scalebarUnit',style:'width:100%;'"
                        data-dojo-attach-point="scalebarUnitDijit">
    <option value="Miles">${nls.unitsMiles}</option>
    <option value="Kilometers">${nls.unitsKilometers}</option>
    <option value="Meters">${nls.unitsMeters}</option>
    <option value="Feet" selected="selected">${nls.unitsFeet}</option>
  </select>
</td>‍‍‍‍‍‍‍‍‍
mpboyle
Frequent Contributor

Thanks a ton Robert Scheitlin, GISP !

BugPie
by
Frequent Contributor

Should I assume this is only available with WAB Developers Edition? 

PRussell
Occasional Contributor
CollinJohnston yes unfortunately, supposedly Experience Builder's next version will finally have the Print widget added to it. Assuming Esri cared more about the Print Widget in EB vs WAB it ought to be an improvement.
 
For WAB's Print Widget changing Miles to Feet solution:
After downloading WAB Dev Edition and unzipping it (I placed it on Desktop as it apparently doesn't matter where it is unzipped on your local drive) access the Print.html as follows and make the code changes to Print.html and overwrite / save it: 
ArcGISWebAppBuilder > client > stemapp> widgets > Print >templates> Print.html
 
It is code lines 151 to 158 when the Print.html file is opened in Notepad.
 
If you want to disable options in  WAB's Print Widget's Advanced settings e.g. 'Output spatial reference WKID:' it is lines 73 to 88 in the Print.html file where code modifications are needed. Instructions for disabling options in WAB's Print Widget's Advanced settings are here
 
Screenshot of various WAB Print Widget Advanced settings that require installing WAB Developer Edition and said code modifications to the Print.html file. 
 
NOTE: If you get "Invalid Client ID" error after downloading / unzipping WAB Dev Edition and running the startup.bat file follow steps here to correct.  Esri refers to Client ID as "app ID" in their documentation for unknown reasons. Be sure to name this new Application file in your AGOL something like 'DO NOT DELETE' since it has to remain in AGOL for WAB Dev Edition's startup.bat to run.
BugPie
by
Frequent Contributor

Wow - thank you, that's a lot of great information @PRussell thank you for sharing. 

0 Kudos
MarcCavallaro
Regular Contributor

@PRussell  do you have examples of the code changes you made to achieve the results in the image you linked to?  I'm looking to auto populate the title and also set the force scale to default to a specific scale.  Thanks!

0 Kudos
GregHornbeek
Emerging Contributor

Good Morning Robert, 

We had the same question and we thought that this would solve our issue too.  We went to the the print templates html, updated the code to the settings that we desire and nothing happened. We have started and stopped the service. We have also restarted the server hoping that this would get the changes to take. Is there anything that you had to do to get those changes to take in WAB?

0 Kudos