Select to view content in your preferred language

map.load not failing when it probably should

671
0
10-04-2016 12:28 PM
Martijnvan_de_Rijdt
New Contributor

I'm testing offline fallback funtcionality for an app that loads the init.js script locally. I'm trying to catch the error. This works fine if I initialize using a portalItem with a webMapID, but not if I use the following:

var webMapConfig = {
         basemap: "streets",
         ground: "world-elevation"
};


map = new WebMap( webMapConfig );

map.load()
   .otherwise( function( error ) {

       // THIS IS NOT REACHED

       console.error('map failed to load');

   })

   .then(function(){

      // THIS IS REACHED

      console.log('map loaded');

   });

The map is completely failing to load (as expected), but for some reason load doesn't reject in 4.0 and 4.1.

Is this a bug or by design?

Cheers,
Martijn

Tags (2)
0 Kudos
0 Replies