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

1791
3
Jump to solution
07-06-2018 03:48 PM
QiZhao
by
Occasional Contributor

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

0 Kudos
1 Solution

Accepted Solutions
QiZhao
by
Occasional Contributor

The basemap gallery issue has been fixed in v4.9 API.

View solution in original post

3 Replies
BradBarnell
Regular Contributor

I am getting the same warning message now in version 4.8 of the API and I don't have any portal items in the basemaps gallery widget.

ToddAtkins
Frequent Contributor

Just adding a "me too" here as well. I have seen this across a couple different apps we've moved over to 4.8.

0 Kudos
QiZhao
by
Occasional Contributor

The basemap gallery issue has been fixed in v4.9 API.