Some ArcGIS Portal Vector Tiles do not work
See original GitHub issueIn some cases the VectorTileServer response is HTML instead of JSON.
When a VectorTileServer has a style with a relative “url” path it is computing the path to the VectorTileServer like this:
url = withPath(url, path);
and url = host + url
In this case, that would be,
url = "/server/rest/services/Hosted/Folder/VectorTileServer/resources/styles/../../"
path = "/server/rest/services/Hosted/England/VectorTileServer/resources/styles/"
The final url looks like https://some.machine/server/rest/services/Hosted/Folder/VectorTileServer/resources/styles/../../
Then setupVectorLayer
creates TileJSON, which queries the url and gets HTML instead of JSON.
The layer fails to render.
If I set a breakpoint here and modify the options.url to be https://some.machine/server/rest/services/Hosted/Folder/VectorTileServer?f=json, then it works:
client.open('GET', options.url)
So the fix would be to have a way to forward query parameter or otherwise modify the url:
url = new URL(host + url).href;
url += "?f=json";
Here is the actual style from https://some.machine/server/rest/services/Hosted/Folder/VectorTileServer/resources/styles/root.json
{ "version": 8, "sprite": "../sprites/sprite", "glyphs": "../fonts/{fontstack}/{range}.pbf", "sources": { "esri": { "type": "vector", "bounds": [ -6.96817, 48.7215, 5.58361, 58.92 ], "minzoom": 0, "maxzoom": 19, "scheme": "xyz", "url": "../../" } }, "layers": [ { "id": "buildings", "type": "fill", "source": "esri", "source-layer": "buildings", "layout": {}, "paint": { "fill-color": "#FCC2CE", "fill-outline-color": "#6E6E6E" } }, { "id": "places", "type": "circle", "source": "esri", "source-layer": "places", "layout": {}, "paint": { "circle-radius": 2.2, "circle-color": "#A13B53", "circle-stroke-color": "#000000", "circle-stroke-width": 0.933333 } } ] }
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
They go through the arcgis web adapter but I can’t speak to what gets forwarded or not. There is no 3rd party proxy. I tried again on port 6443 to bypass the adaptor and got the same result. https://my-server:6443/arcgis/rest/services/Hosted/UK/VectorTileServer
Could it be that these requests go through a proxy which does not pass the headers along?