Build your first app

ArcGIS Web AppBuilder is a map-centric application. It provides a map property defined in the BaseWidget class to access the map. You can access the map property through this map. The widget’s map property is a type of esri.Map from ArcGIS API for JavaScript, configured in the config.json file. You can access all map features provided by ArcGIS API for JavaScript. Code the widget the same as you would write a regular ArcGIS JavaScript application.

When a widget instantiates, the map passes into it. As a result, you can access a map property in the postCreate or startup methods.

Modify the UI template and add a div tag to display the map ID property:

      <div data-dojo-attach-point="mapIdNode"></div>

Add JavaScript code to Widget.js to access the map:

startup: function(){
  this.mapIdNode.innerHTML = 'map id:' +;

For a 3D widget, the map property is replaced by sceneView. Use this.sceneView to access the scene in your widget.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.