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.