How to add MapImageLayer into BasemapGallery

935
3
Jump to solution
05-24-2018 06:47 PM
prashantk
New Contributor III

Hi All,

I want to display custom  basemap with overlay image so I am using "MapImageLayer" class to add layer on map. 

Apart from this I have two custom basemaps so, I used dojo BasemapGallery widget to display collection of basemaps.

Is there any way to add  "MapImageLayer"  into "BasemapGallery"  widget?

Any help would be appreciated

Thanks & Regards,

Prashant

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Prashant,

Using a MapImageLayer is not supported. Your layer has to be cached and you have to use TileLayer at least.

   

Sure just load your cached layer as a basemap class:

Basemap | API Reference | ArcGIS API for JavaScript 4.7 

Then specify the BaseMapGallery widgets LocalBasemapsSource property

LocalBasemapsSource | API Reference | ArcGIS API for JavaScript 4.7 

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Prashant,

Using a MapImageLayer is not supported. Your layer has to be cached and you have to use TileLayer at least.

   

Sure just load your cached layer as a basemap class:

Basemap | API Reference | ArcGIS API for JavaScript 4.7 

Then specify the BaseMapGallery widgets LocalBasemapsSource property

LocalBasemapsSource | API Reference | ArcGIS API for JavaScript 4.7 

prashantk
New Contributor III

Thanks Robert,

It really helps to resolve issue.

Prashant,

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Great. Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos