The 2D and 3D in WAB (development version) are based on the ArcGIS for JavaScript API 3.20 online version and ArcGIS for JavaScript api 4.3 online. In the case of network anomaly, it is likely to encounter JS API loading slow or even wrong dilemma, resulting in the use of WAB (development version) to build applications. This section describes how to use the Portal for ArcGIS built-in JS API to replace the JS API referenced by WAB (development version). Get portal for ArcGIS built-in JS API Portal for ArcGIS built-in 2D JS API
The basic form of Portal for ArcGIS built-in 2D JS API access address is as follows:
"The machine name for the Portal for ArcGIS Machine"/arcgis/jsapi/jsapi
Take the author of this machine as an example, the actual access address is Http://zhangsai.esrichina.com/arcgis/jsapi/jsapi Portal for ArcGIS built-in 3D JS API
The basic form of Portal for ArcGIS built-in 3D JS API access address is as follows:
"The machine name for the Portal for ArcGIS Machine"/arcgis/jsapi/jsapi4
To the author of this machine for example, the actual access address is HTTP://ZHANGSAI.ESRICHINA.COM/ARCGIS/JSAPI/JSAPI4 2D under the JS API replacement
1 Open the Env.js file under "WAB Extract directory" \client\stemapp
2 Go to line 98th of env.js file, replace with portal for ArcGIS built-in 2D JS API
Before replacing:
Apiurl = '//js.arcgis.com/3.20 ';
After replacement:
Apiurl = '//zhangsai.esrichina.com/arcgis/jsapi/jsapi '; 3D the replacement of JS API
1 Open the Env.js file under "WAB Extract directory" \client\stemapp3d
2 Go to line 96th of env.js file, replace with portal for ArcGIS built-in 3D JS API
Before replacing:
Apiurl = '//js.arcgis.com/4.3 ';
After replacement:
Apiurl = '//zhangsai.esrichina.com/arcgis/jsapi/jsapi4 '; Restart WAB
After restarting the WAB, it automatically references the replacement JS API when you access the WAB build application again.
If you have deployed an offline 2D and 3D JS API, you can also refer directly to these offline deployment JS APIs.