1

I have a CSS styled layer in GeoServer 2.16.1 with CSS Extension and trying to bring my layer to Mapbox. Unfortunately it comes only as simple lines.

CSS LineString Layer Geoserver

Preview from geoserver

But if bring this layer to Mapbox it shows simple lines like below:

Lines in React app with Mapbox

map.addLayer({
      id: 'streets',
      type: 'line',
      source: {
        type: 'vector',
        tiles: [
          'http://localhost:80/geoserver/gwc/service/wmts?layer=geoapp:lines&tilematrixset=EPSG:900913&Service=WMTS&Request=GetTile&Version=1.0.0&Format=application/x-protobuf;type=mapbox-vector&TileMatrix=EPSG:900913:{z}&TileCol={x}&TileRow={y}'
        ]
      },
      'source-layer': 'lines'
      /* ,
      layout: {
        'line-join': 'round',
        'line-cap': 'round' 
      },
      paint: {
        'line-color': '#08363e',
        'line-width': 0.8
      } */
    });

Any hint, suggestion, or other way around?

2

That is as expected, vector tiles are rendered (and styled) at the client end so GeoServer ignores your styling when serving vector tiles.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.