map.setbasemap for vector tiles

179
1
Jump to solution
12-13-2021 07:35 PM
ADITYAKUMAR1
Occasional Contributor II

Hi,

  I have added vector tile as base map in base map gallery. On toggle this is working as expected.Below is the code to add basemap while map load. This code works for ArcGIS dynamic map service or Tiled map service. But below code does not work for Vector tile layer.

Basemaps.mybasemap = {
title: 'My custom basemap',
thumbnailUrl: baseMapService.MapServiceURL + '/info/thumbnail',
baseMapLayers: [
{ url: baseMapService.MapServiceURL }
]
};
map.setBasemap("mybasemap");
}

Is there a way we can add vector tile as bassemap on load?

 

Thanks

Aditya Kumar

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ADITYAKUMAR1
Occasional Contributor II

I have managed to fix it. Below are the changes in the code.

Basemaps.mybasemap = {
title: 'My custom basemap',
itemId: "xxxxxxxxxxxxxxxxxxxxxxxx",
thumbnailUrl: baseMapService.MapServiceURL + '/info/thumbnail',
baseMapLayers: [
{
url: baseMapService.MapServiceURL,
type: "VectorTile"
}
]
};

map.setBasemap("mybasemap");

 

Thanks

View solution in original post

0 Kudos
1 Reply
ADITYAKUMAR1
Occasional Contributor II

I have managed to fix it. Below are the changes in the code.

Basemaps.mybasemap = {
title: 'My custom basemap',
itemId: "xxxxxxxxxxxxxxxxxxxxxxxx",
thumbnailUrl: baseMapService.MapServiceURL + '/info/thumbnail',
baseMapLayers: [
{
url: baseMapService.MapServiceURL,
type: "VectorTile"
}
]
};

map.setBasemap("mybasemap");

 

Thanks

0 Kudos