Web Appbuilder is a fast webgis application building tool from ESRI, with the following features:
- No programming required to quickly create apps
- WYSIWYG Interactive App
- Supports 2D and 3D applications
- Based on ArcGIS API for JavaScript, HTML5
- Supports running apps on multiple devices
The Web Appbuilder is available in both built-in and development versions. Based on the development version, developers can customize the development of new plugins and themes based on their business. In the process of custom development, developers often need to reference third-party JavaScript class libraries. The following describes how to share these third-party class libraries in web Appbuilder development.
1. First add the third-party libraries that need to share the references to the following directory: <webappbuilderforarcgis installation directory >\client\stemapp\libs.
2. Modify the <webappbuilderforarcgis installation directory >\client\stemapp\libs\main.js. Add the third-party class library that you just added in the dependency array of the Define function. To add the Echart class library as an example:
Define (["./usng/usng", "./storejs/json", "./storejs/store", "./md5/md5", "./qrcode", "./echarts"], function () {
});
3. Reference in the definition code of the widget that needs to reference the class library. This assumes that the directory structure of Widget.js is <webappbuilderforarcgis installation directory >\client\stemapp\Widgets\< Custom widget directory >\ Widget.js, the definition code widget.js should refer to the Shared class library:
define ([' Dojo/_base/declare ', ' jimu/basewidget ', ' ... /.. /libs/echarts "]
, function () {
});
How Web AppBuilder Widgets use shared class libraries