Description
There are 2 labeling issues in Kibana when using Vector tiles.
- Multiple labels for MultiPolygon and MultiLineString geometries.

- Multiple labels for features that span tiles. For example, hexagons that span tile boundaries.

The recommended solution is to provide features for labels, where the feature geometry is the label location.
To resolve these issues, I propose adding a new parameter, withLabels, to _mvt API that when true would add label features to the response. Label features could be added in 2 ways
- another layer, "label", in the response. The "label" layer will contain Point feature for each hit and agg feature. For agg features, the Point feature will be the center of the hexagon. For hit features, the Point feature will be the centroid of the largest polygon for MultiPolygon and the centroid for the longest line for MultiLineString.
- Include label feature in existing "hits" and "aggs" layers. Give label feature a property like "__EsIsLabelFeature" so filter expressions can be used exclude features in style rules.
Kibana is creating these centroid features today for GeoJSON sources. Kibana includes label features in GeoJSON feature collection and uses filters to exclude features in style rules (option 2 above)
cc @jsanz @thomasneirynck
Description
There are 2 labeling issues in Kibana when using Vector tiles.
The recommended solution is to provide features for labels, where the feature geometry is the label location.
To resolve these issues, I propose adding a new parameter,
withLabels, to_mvtAPI that whentruewould add label features to the response. Label features could be added in 2 waysKibana is creating these centroid features today for GeoJSON sources. Kibana includes label features in GeoJSON feature collection and uses filters to exclude features in style rules (option 2 above)
cc @jsanz @thomasneirynck