Skip to content

[Maps] labels for polygons and lines#86191

Merged
nreese merged 29 commits intoelastic:masterfrom
nreese:polygon_labels2
Jan 7, 2021
Merged

[Maps] labels for polygons and lines#86191
nreese merged 29 commits intoelastic:masterfrom
nreese:polygon_labels2

Conversation

@nreese
Copy link
Copy Markdown
Contributor

@nreese nreese commented Dec 16, 2020

Fixes #61468 and #17022

This PR adds support for labeling lines and polygons. This is accomplished by adding a centroid feature for each line, multiLine, polygon, and multiPolygon feature. Existing styling layers use mapbox expressions to filter out these centroid features.

The centroid is defined as the following for each feature type.

  • line centroid is center point of string
  • multiLine centroid is center point of longest string
  • polygon centroid is center of mass of polygon
  • multiPolygon centroid is center of mass of largest polygon

Screen Shot 2020-12-16 at 1 58 39 PM

Screen Shot 2020-12-16 at 1 58 18 PM

Even supports labels for mvt tiles
Screen Shot 2020-12-16 at 3 37 30 PM

@nreese nreese added release_note:enhancement WIP Work in progress Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.12.0 labels Dec 16, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@nreese nreese changed the title @nreese [Maps] labels for polygons and lines [Maps] labels for polygons and lines Dec 16, 2020
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Dec 18, 2020

@elasticmachine merge upstream

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 4, 2021

@elasticmachine merge upstream

@nreese nreese removed the WIP Work in progress label Jan 4, 2021
@nreese nreese requested a review from thomasneirynck January 4, 2021 13:52
@nreese nreese requested a review from a team as a code owner January 4, 2021 20:44
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 5, 2021

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 7, 2021

@elasticmachine merge upstream

@nreese nreese requested a review from thomasneirynck January 7, 2021 15:11
Copy link
Copy Markdown
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, this is so good.

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
maps 661 681 +20

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.8MB 1.8MB +98.0B
maps 2.8MB 2.9MB +37.7KB
total +37.8KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
maps 153.6KB 153.7KB +174.0B
upgradeAssistant 60.0KB 60.1KB +98.0B
total +272.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese merged commit 0ac6e62 into elastic:master Jan 7, 2021
nreese added a commit to nreese/kibana that referenced this pull request Jan 7, 2021
* [Maps] labels for polygons and lines

* remove x-pack yarn.lock

* add labels to choropleth map wizard

* clean up comment

* add mvt tile support

* only add centroids if there may be lines or polygons

* tslint

* tslint

* do not add centroid to too many features polygon

* update get_tile expect statements

* move turf dependencies from devDependencies to dependencies

* update jest snapshot and functional test expects

* fix functional test expect

* another functional test expect update

* functional test updates

* expect

* pew pew source expect updates

* update joins expect

* update mapbox style expects

* update join visibility expects for geocentroids

* update join visibility expects for geocentroids

* another functional test expect update

* review feedback

* update yarn.lock

* tslint

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Jan 7, 2021
* [Maps] labels for polygons and lines

* remove x-pack yarn.lock

* add labels to choropleth map wizard

* clean up comment

* add mvt tile support

* only add centroids if there may be lines or polygons

* tslint

* tslint

* do not add centroid to too many features polygon

* update get_tile expect statements

* move turf dependencies from devDependencies to dependencies

* update jest snapshot and functional test expects

* fix functional test expect

* another functional test expect update

* functional test updates

* expect

* pew pew source expect updates

* update joins expect

* update mapbox style expects

* update join visibility expects for geocentroids

* update join visibility expects for geocentroids

* another functional test expect update

* review feedback

* update yarn.lock

* tslint

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:enhancement Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.12.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Maps] Labels for all geometry types

4 participants