The solution I found is using a GridSet in Google Mercator
that has 512x512
tiles like EPSG:900913x2
and flipping the Y axis using flipY=true. I am not sure if it really always needs to be 512x512
tiles in size, but ESRI at least requires it for Pro and it's also working in JS.
My final settings look like:
const vecSettings = {
style: {
"version": 8,
"sources": {
"sample": {
"type": "vector",
"scheme": "tms",
"tiles": [
`http://localhost:8080/geoserver/sample/gwc/service/tms/1.0.0/sample:sample@EPSG:900913x2@pbf/{z}/{x}/{y}.pbf?token=${jwt}&flipY=true`
],
"minZoom": 0,
"maxZoom": 19
}
},
"layers": [
{
id: 'sample',
type: "circle",
source: "sample",
"source-layer": "sample",
layout: {},
paint: {
"circle-color": "#31d8f9",
"circle-stroke-color": "#000000",
"circle-stroke-width": 2
}
}
]
}
};
const layer = new VectorTileLayer(vecSettings);
If you are using the AuthKey
plugin the token paramater can also be set in the tiles URL
. Also the Geofence
plugin is working in combination with GWC and Vector Tiles and all rules are applied accordingly.
wmts
url which is not working as ESRI will not replace x/y/z accordingly. Usingtms
is not working either as the y paramater is not set correct. I also tried using EPSG:3857 / EPSG:900913 and also defining the AGOL:3857 Gridset. Nothing works. It looks like ESRI is ignoring the"scheme": "tms"
option in the source. Did anyone manage to display Geoserver Vector Sources in ESRI JS 4.x?