Select to view content in your preferred language

Vector tiles as basemap on map load

451
1
Jump to solution
12-10-2021 04:52 AM
ADITYAKUMAR1
Occasional Contributor III

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

 

0 Kudos
1 Solution

Accepted Solutions
ADITYAKUMAR1
Occasional Contributor III

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 III

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