BasemapGallery - excluding certian ArcGIS stock basemaps

Discussion created by edmahon on Feb 1, 2014
Latest reply on Apr 18, 2014 by sarahclark
I'm looking at a basemap gallery that contains a user-defined subset of the basemaps returned when ArcGISBasemaps = true.

Rather than duplicate/re-mangage the internals of the gallery widget (i.e. maintain the data and manually load the subset of interest - a big YUK! for externally managed dependencies that can change), the obvious algorithm is to specify all ArcGIS basemaps and simply remove the exclusion set after their load completes.  I can think of three simple approaches (which I can't find any solid reference or discussions on are):

1. Let the basemap gallery load and on the 'load' event notification, remove the basemaps that aren't required.  Remove requires the basemap ID.


A) The well-known basemap names (e.g. topo, national-geographic, etc.) are nowhere in the basemap data structures after loading to perform lookups for ID/removal.
B) The ids assigned are layer_0, layer_x,... layer_8 and no way to map back to the original well-known name.  I don't want to depend on free-range data (e.g. title fields) or an attribute that is not 110% deterministic for values.

2. Filter out the unwanted basemaps in the initial load.


A) It appears to be an all-or-nothing.

3. Obtain the various basemap titles somehow and use that field to perform the lookup, to get the layer ID, to perform the removal.


A) How to get the various stock basemap titles assigned by ArcGIS.

Any help or definitive guidance would be greatly appreciated.  Seems like an reasonable requirement that's been entirely overlooked...

Thanks in advance!