Mapbox GL support for label placement at center of line

1212
1
01-03-2020 08:16 AM
EricHerbert
New Contributor

I've tried to set the placement of some labels at the center of a line within the vector tile style file, but it doesn't appear that the vector tiles honor the "symbol-placement": "line-center" property.  After setting the property to line-center, all of the labels appear to default back to the "point" symbol placement.

Do vector tile layers not honor all of the properties included in the Mapbox style spec?

Tags (2)
0 Kudos
1 Reply
RogerAustin
New Contributor II

I have encountered the same problem. I ended up by creating separate symbol layers (one for each line layer) containing my line center-points and putting my symbols in those. Since some of the symbols were arrows that I wanted to be oriented along the line, I also had to compute the orientation of the relevant line segments and add these as rotation properties for my symbols. All a bit painful.

ArcGIS JS styles conform to the Mapbox style spec, but that does not mean that all of the spec is supported (not even Mapbox support all of the spec). In particular, expressions for data values and filters are not supported. Instead, you have to use the old (deprecated) filter and function syntax.

0 Kudos