Custom basemaps in basemap gallery

533
2
Jump to solution
11-05-2018 08:46 AM
ShakilChoudhury
New Contributor III

I've added my custom basemap to my basemap gallery but can't figure out how to add other basemaps.

var customBMs = new LocalBasemapsSource(
{
basemaps:[
   bm,
   Basemap.fromId("OS Open Background"),
   Basemap.fromId("OS Open Carto"),
   Basemap.fromId("OS Open Grey Labels"),
   Basemap.fromId("OS Open Grey"),
   Basemap.fromId("OS Open Rasters")
]
}
);

var basemapGallery = new BasemapGallery({
view: view,
source:customBMs
});

What id do I use for the OS Open maps? I've tried portal ids with no luck

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ShakilChoudhury
New Contributor III

Got it to work by just pushing to the existing basemapGallery.source.basemaps.items array instead of providing a new one

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Shakil,

   All basemaps have to have the same spatial reference and be cached at the same LODs.

0 Kudos
ShakilChoudhury
New Contributor III

Got it to work by just pushing to the existing basemapGallery.source.basemaps.items array instead of providing a new one