AnsweredAssumed Answered

[JSAPI 4.8][BasemapGallery] Local basemap source fetch error

Question asked by Justdoit011 on Jul 6, 2018
Latest reply on Nov 8, 2018 by Justdoit011

I'm using BaseMap Gallery Widget with local basemap source. After I switch to latest v4.8 JSAPI, there is an error message in the console. The gallery looks fine and everything is working, but the error message is very strange and doesn't make a lot of sense.

 

fetch-basemaps-error

 

The message says "Could not fetch basemaps from portal." Below is my source code. I only use an array of local base maps as the source, which has been already loaded in browser memory. Why the API is trying to fetch more basemaps from portal? I provided the basemap source in widget gallery constructor, so the widget should just use my local source, not create a new portal source. Maybe there is an issue in widget constructor or in basemap source autocast?

 

By the way, the console error is not seen in v4.7 API, but I can see an HTTP request is sent to fetch portal basemaps.

 

var basemapGallery = new BasemapGallery({
  view: view,
  source: [
    Basemap.fromId("streets-navigation-vector"),
    Basemap.fromId("satellite"),
    Basemap.fromId("hybrid")
  ]
});

 

Here is a running example:

https://codepen.io/anon/pen/qKeBWw

Outcomes