samples/amd/js/actions/MapActions.js
function createMap(mapConfig) {
      app.debug('MapActions >>> createMap');
      var basemap = (0, _jsUtilsParams.getUrlParams)(location.href)[_jsConstantsAppConstants.MAP.basemap];
      if (basemap) {
        mapConfig.options.basemap = basemap;
      }
      var deferred = new Promise(function (resolve) {
        app.map = new _EsriMap['default'](mapConfig.id, mapConfig.options);
        app.map.on('load', function () {
          resolve();
        });
      });

      return deferred;
    }
function createMap(mapConfig) {
      app.debug('MapActions >>> createMap');
      var basemap = (0, _jsUtilsParams.getUrlParams)(location.href)[_jsConstantsAppConstants.MAP.basemap];
      if (basemap) {
        mapConfig.options.basemap = basemap;
      }
      var deferred = new Promise(function (resolve) {
        app.map = new _EsriMap['default'](mapConfig.id, mapConfig.options);
        app.map.on('load', function () {
          resolve();
        });
      });

      return deferred;
    }
function createMap ( mapConfig ) { app . debug ( 'MapActions >>> createMap' ) ; var basemap = ( 0 , _jsUtilsParams . getUrlParams ) ( location . href ) [ _jsConstantsAppConstants . MAP . basemap ] ; if ( basemap ) { mapConfig . options . basemap = basemap ; } var deferred = new Promise ( function ( resolve ) { app . map = new _EsriMap [ 'default' ] ( mapConfig . id , mapConfig . options ) ; app . map . on ( 'load' , function ( ) { resolve ( ) ; } ) ; } ) ; return deferred ; }
Simple method to create a new Map
@param {object} mapConfig - config object containing id and options
@return {Promise} deferred - Promise that resolves on map load event
Simple method to create a new Map