Question: Is there a reason to use a TMS over WMTS call to GeoServer to pull vector tiles?
My goal is to pull vector tiles from my Geoserver to my Leaflet-based web application. Unfortunately, the Geoserver docs only explain something for OpenLayers (example using TMS), so I'm unsure what is good practice. I have installed Vector Tiles Extension into Geoserver and L.vectorGrid.protobuf into my Leaflet application.
My options for retrieving these vector tiles seem to be between TMS and WMTS, but I don't know why I would choose one over the other.
My calls are in this format:
WMTS L.vectorGrid.protobuf:
var myLayer = L.vectorGrid.protobuf('http://localhost:8000/geoserver/gwc/service/wmts/rest/city:roads/line/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=application/vnd.mapbox-vector-tile').addTo(this.map);TMS L.vectorGrid.protobuf call:
var myLayer = L.vectorGrid.protobuf('http://localhost:8000/geoserver/gwc/service/tms/1.0.0/city:roads@EPSG:900913@pbf/{z}/{x}/{-y}.pbf').addTo(this.map);
Both seem to render the same, just a slight difference in the response when there is an out-of-bound tile requested:
TMS: gives a 404 response for out-of-bound tiles
WMTS: gives a 400 response for out-of-bound tiles
So why choose TMS or WMTS when retrieving vector tiles from GeoServer?
Updates to prior text:
As mentioned by @TomazicM, L.tileLayer renders only raster layers, so is not appropriate for vector tiles (also briefly mentioned in Leaflet under the Raster heading).
@TomazicM, would you recommend I remove this question and ask them separately?
– Logreen Mar 16 '23 at 20:56L.tileLayeris for raster layers, so you can't use it for vector layers. – TomazicM Mar 17 '23 at 09:06