I have uploaded the data to a local Geoserver and am connecting it to my map on MapBox GL JS. The data is displayed correctly on the map and does not cause any errors in the logs. But when I start moving the map to where the data is not, the following errors pop up in the logs:
xe {status: 400, url: 'http://localhost:8081/geoserver/gwc/service/wmts?R…/vnd.mapbox-vector-tile&TILECOL=2478&TILEROW=1277', message: 'Bad Request'}
xe {status: 400, url: 'http://localhost:8081/geoserver/gwc/service/wmts?R…/vnd.mapbox-vector-tile&TILECOL=2477&TILEROW=1277', message: 'Bad Request'}
xe {status: 400, url: 'http://localhost:8081/geoserver/gwc/service/wmts?R…/vnd.mapbox-vector-tile&TILECOL=2476&TILEROW=1276', message: 'Bad Request'}
I understand that GeoServer tries in these squares to find tiles, does not find them and an error is issued. Is there any way to avoid it?
The way I connect the layer:
map.addSource("buildings_pushkino_how_old", {
// может быть любое имя
type: "vector",
tiles: [
"http://localhost:8081/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=how_old:buildings_pushkino_how_old_wfs&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/vnd.mapbox-vector-tile&TILECOL={x}&TILEROW={y}",
],
});
map.addLayer({
id: "buildings_pushkino_how_old_id",
type: "fill",
source: "buildings_pushkino_how_old",
"source-layer": "buildings_pushkino_how_old_wfs", // Имя слоя в Geoserver
paint: {
"fill-color": "#ff0000",
"fill-opacity": 0.5,
},
});
