How Web AppBuilder Widgets use shared class libraries

Source: Internet
Author: User
Tags define function

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.