Basemap Gallery - not loading selected basemap

504
3
06-04-2018 10:05 AM
MathewMullan1
New Contributor

I have a web map that I load from its portal id and after it loads I create a basemapGallery. The basemap gallery shows up correctly but any time I choose a different basemap, the basemap for the map goes blank/white background and only the graphics appear on the map. Any idea why?

var webmap = new WebMap({ portalItem: { id: "xxxx" }});

webMapView = new MapView({ container: "MapDiv", map: webmap, center: [lat, long], zoom: zoom});

var basemapGallery = new BasemapGallery({ view: webMapView, container: document.createElement("div") });
var bgExpand = new Expand({
view: webMapView,
content: basemapGallery.container,
expandIconClass: "esri-icon-basemap"
});
webMapView.ui.add(bgExpand, { position: "top-left" });

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Mathew,

   Sounds like you Web Maps basemap is in a different spatial then the standard esri base maps which are WKID 102100. All the basmeps that particupate in the BaseMap Gallery have to be in the same WKID.

0 Kudos
MathewMullan1
New Contributor

Is there a way for me to change the spatial for the web map when its loaded?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mathew,

   No the web maps basemap itself has to be 102100 for it to be used in conjunction with esri basemaps.

0 Kudos