English

How To: Change the default output spatial reference of the Print widget in Web AppBuilder for ArcGIS (Developer Edition)

Summary

The default output spatial reference of the Print widget in Web AppBuilder for ArcGIS is the WGS 1984 Web Mercator Auxiliary Sphere with well-known ID (WKID) 102100. When using the Print widget and setting the Force scale option to a value that prints a specific map extent, the output map extent is sometimes smaller than the specified extent. This discrepancy increases if the data is located farther away from the Equator. To reduce map extent discrepancies, the output spatial reference must be set to a local spatial reference depending on the location of the data.

The instructions provided describe how to preset the Print widget in Web AppBuilder for ArcGIS (Developer Edition) to use a local spatial reference that produces accurate output measurements.

Procedure

  1. Open the Web AppBuilder for ArcGIS folder and navigate to the Print widget JavaScript file. The file is located in the following path:
C:\WebAppBuilderForArcGIS\server\apps\<app id>\widgets\Print
Double-click the Print.js file to open it.
  1. In the JavaScript file, go to line 149 and replace this.wkidInput.set('value', this.map.spatialReference.wkid) with this.wkidInput.set('value',<local spatial reference WKID>). In this example, the new local spatial reference WKID is 103434.
An image of the Print widget JavaScript file.
  1. Save the edited JavaScript file.
  2. Refresh the app and open the advanced settings of the Print widget. The inserted WKID is the default spatial reference of the Print widget.
An image of the new default WKID.

Related Information