Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] Repeated labels for vector tile layers #130675

Closed
jsanz opened this issue Apr 20, 2022 · 5 comments · Fixed by #132080
Closed

[Maps] Repeated labels for vector tile layers #130675

jsanz opened this issue Apr 20, 2022 · 5 comments · Fixed by #132080
Assignees
Labels
bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product.

Comments

@jsanz
Copy link
Member

jsanz commented Apr 20, 2022

Kibana version: main

Elasticsearch version: main

Server OS version: Ubuntu 20.04

Browser version: Version 1.37.116 Chromium: 100.0.4896.127 (Official Build) (64-bit)

Browser OS version: Ubuntu 20.04

Original install method: from source

Describe the bug:

Data rendered from Elasticsearch as vector layers with multiple geometries get a label on each geometry.

Steps to reproduce:

  1. Index world_countries GeoJSON file from https://maps.elastic.co/#file/world_countries
  2. Add it as a layer
  3. Label the iso2 field
  4. Switch between scaling methods Use Vector Tiles and Limit results to 10.000

Expected behavior:

The labeling should be similar between scaling methods.

This repeated labels issue is also present when using Hexagon grids.

Screenshots (if relevant):

Peek 2022-04-20 16-17

Peek 2022-04-20 16-21

@jsanz jsanz added bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation labels Apr 20, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese
Copy link
Contributor

nreese commented Apr 20, 2022

There are 2 things going on in this issue

For the first case where there are multiple labels per world country: this occurs because maplibre adds a label to each polygon and line in MultiPolygon and MultiLineString. When using GeoJSON, the problem is resolved by creating a single label location. For MultiPolygon, the label location is the centroid of the largest polygon. For MultiLineString, the label location is the centroid of the longest line. This workaround is not available when using vector tiles and another solution is needed.

For the second case where there are multiple labels for a hexagon, this occurs when a hexagon crosses a tile boundary and maplibre labels the feature in both tiles.

@jsanz jsanz changed the title [Maps] Repeated labels for vector layers [Maps] Repeated labels for vector tile layers Apr 20, 2022
@jsanz
Copy link
Member Author

jsanz commented Apr 20, 2022

For the second case where there are multiple labels for a hexagon, this occurs when a hexagon crosses a tile boundary and maplibre labels the feature in both tiles.

This is a known issue for mapboxgl-js mapbox/mapbox-gl-js#5583 and suggested workarounds seem go in the direction of creating a full new layer for the labeling.

@nreese
Copy link
Contributor

nreese commented Apr 20, 2022

Elasticsearch is going to need to provide label features to resolve this issue. I created elastic/elasticsearch#86044 in Elasticsearch repo to track the issue

@nreese nreese added blocked impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Apr 20, 2022
@nreese nreese self-assigned this May 12, 2022
@nreese nreese removed the blocked label May 20, 2022
@nreese
Copy link
Contributor

nreese commented May 20, 2022

unblocked with elastic/elasticsearch#86458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants