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] Extra decimals added in fractional part of labels in maps when using vector tiles #183527

Closed
Tracked by #154870
nreese opened this issue May 15, 2024 · 2 comments
Closed
Tracked by #154870
Labels
bug Fixes for quality problems that affect the customer experience Feature:Maps Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@nreese
Copy link
Contributor

nreese commented May 15, 2024

Problem

Vector tiles read the value from the fields option that uses _source but it then cast the value to the fields type. Fields mapped as float are displayed as the float representation. For example, 2.3 is displayed as 2.299999952316284.

It can be easily reproduced by doing:

PUT /test_float
{
  "mappings": {
    "properties": {
      "field":    { "type": "float" },
      "location" : {"type": "geo_point" }
    }
  }
}

POST test_float/_doc
{
  "field" : 2.3, "location" : "POINT(0 0)"
}

GET test_float/_mvt/location/0/0/0
{
  "fields": ["field"],
  "grid_precision" : 0
}

Potential solutions

There is no way to format that value in the vector tiles API.

One possible solution is to allow users to specify a maplibre expression to format the label, for example, users could configure number-format

@nreese nreese added bug Fixes for quality problems that affect the customer experience Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Feature:Maps labels May 15, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@ThomThomson
Copy link
Contributor

Closing this as we have added it to our icebox for the time being.

@ThomThomson ThomThomson closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
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 Feature:Maps Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

3 participants