Vector Tile Basemap Layers

1778
1
Jump to solution
05-05-2021 11:36 AM
NathanHeickLACSD
Occasional Contributor III

I am developing a new Web AppBuilder app and at the very beginning I wanted to leverage vector tile layers in the basemaps and the Basemap Gallery widget.  As I remember, this is not supported but I tried anyways.  I was able to get it to work just fine by editing the web map JSON and the Basemap Gallery widget config.  I just had to use the right attributes.  For example, I added this as one of the basemap layers in my web map:

 

 

{
    "opacity": 1,
    "title": "Topography - Small Scales",
    "maxScale": 12767.488095,
    "visibility": true,
    "styleUrl": "https://www.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",
    "layerType": "VectorTileLayer",
    "minScale": 295828763.7957775,
    "type": "VectorTileLayer",
    "id": "TopographySmallScales"
}

 

 

Originally, I had no problems whatsoever, but after a few months I started seeing an issue.  If I leave the web app open overnight, the vector tiles disappear.  Also, if I clear the cache, the first time I load the app, it doesn't even request the tiles from the server.  If I refresh the app, on the second load the tiles appear just fine.  I really want to use vector tile layers even if it isn't supported.  Does anyone have any idea why the vector tiles disappear overnight or just don't show up on load until it has been loaded recently for a second time.

After more research, the app does download the vector tile style files on the first attempt, but it does not send any requests for the protocol buffers until the second attempt.

0 Kudos
1 Solution

Accepted Solutions
NathanHeickLACSD
Occasional Contributor III

I worked with Esri Technical Support and it finally started working after I made some schema changes as part of development and republished the map service.  I got errors in WAB saying it could not load certain layers, but the basemaps started working all the time.  When I finished fixing the web map for the schema changes, it still worked.  It's not clear what caused the issue.  Maybe it was duplicate layer IDs.  Maybe it was the web map config.  The issue never occurred in the Portal for ArcGIS Map Viewer.  Hopefully, this helps someone else.

The cause doesn't seem to be the basemaps.  The basemaps seem to be impacted by something in the map service or web map.

View solution in original post

0 Kudos
1 Reply
NathanHeickLACSD
Occasional Contributor III

I worked with Esri Technical Support and it finally started working after I made some schema changes as part of development and republished the map service.  I got errors in WAB saying it could not load certain layers, but the basemaps started working all the time.  When I finished fixing the web map for the schema changes, it still worked.  It's not clear what caused the issue.  Maybe it was duplicate layer IDs.  Maybe it was the web map config.  The issue never occurred in the Portal for ArcGIS Map Viewer.  Hopefully, this helps someone else.

The cause doesn't seem to be the basemaps.  The basemaps seem to be impacted by something in the map service or web map.

0 Kudos