Access a map

Web AppBuilder for ArcGIS 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 JavaScript API, configured in the config.json file. You can access all map features provided by ArcGIS JavaScript API. Code the widget the same as writing 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 access the map:

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

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