I've applied MBstyle (gs-mbstyle-2.13.2, gt-mbstyle-19.3) extension for GeoServer (2.13.2) to style layers in mvt format. It works fine for simple styling but the problem occurs when I want to set the line-width of features based on the zoom level of the map display. I've used the following snippet but Goserver throws me this error:

org.geotools.mbstyle.parse.MBFormatException: "line-width" number from JSONArray not supported

  "version": 8,
  "name": "cyan line",
  "layers": [
      "id": "road",
      "type": "line",
      "paint": {
      "line-color": "#0099cc",
     "line-width": [
         ['exponential', 2],

Is it something wrong with MBstyle version or something else causes the problem?


Just had a quick look at the current code, it seems it's still design to work only with a simple number.

The MBStyle module is officially unsupported (community module), and does not promise to support the whole syntax or just any version of MBStyles (I think it's based on an older one than the current), the bits that are supposedly working are listed here, where line-style is listed as just taking a number: https://docs.geoserver.org/stable/en/user/styling/mbstyle/reference/spec.html#line-width

  • Thanks, Andrea. Does it support with Mapbox SDKs? Dec 15 '18 at 5:16
  • No clue, but if I had to make a guess, I'd say no. Dec 17 '18 at 9:28

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.