greensopinion / flutter-vector-map-tiles

A plugin for `flutter_map` that enables the use of vector tiles.
BSD 3-Clause "New" or "Revised" License
140 stars 70 forks source link

Street labels not centering properly #126

Open aamirki opened 1 year ago

aamirki commented 1 year ago

I have this set in my stylesheet for highway_name_other:

{
      "filter": [
        "all",
        [
          "!in",
          "class",
          "motorway",
          "trunk",
          "primary",
          "secondary",
          "tertiary"
        ],
        ["==", "$type", "LineString"]
      ],
      "id": "highway_name_other",
      "layout": {
        "symbol-placement": "line-center",
        "text-anchor": "center",
        "text-justify": "center",
        "symbol-spacing": 350,
         "text-field": [
          "concat",
          ["get", "name:latin"],
          [
              "case",
              ["all", ["has", "name:nonlatin"], ["is-supported-script", ["get", "name:nonlatin"]]],
              ["concat", " ", ["get", "name:nonlatin"]],
              ""
          ]
      ],
        "text-font": ["Noto Sans Regular"],
        "text-max-angle": 30,
        "text-pitch-alignment": "viewport",
        "text-rotation-alignment": "map",
        "text-size": 12,
        "visibility": "visible"
      },
      "paint": {
        "text-color": "#888"
      },
      "source": "openmaptiles",
      "source-layer": "transportation_name",
      "type": "symbol"
    },

Which I expect to center the text onto these roads, as you can see when I load this style into Maputnik: image However if I do the same in Flutter Map using this plugin I get this result: image It seems that the text is not centering properly but only on Flutter Map, which is strange that the result would be different at all. Is this expected?

greensopinion commented 1 year ago

this is likely a bug in https://github.com/greensopinion/dart-vector-tile-renderer

feel free to make a contribution