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] labels for polygons and lines #86191

Merged
merged 29 commits into from
Jan 7, 2021
Merged

Conversation

nreese
Copy link
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 [Deprecated-Use Team:Presentation]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
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
Contributor Author

nreese commented Dec 18, 2020

@elasticmachine merge upstream

@nreese
Copy link
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
Contributor Author

nreese commented Jan 5, 2021

@elasticmachine merge upstream

Copy link
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

x-pack/plugins/maps/common/get_centroid_features.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/common/get_centroid_features.ts Outdated Show resolved Hide resolved
@nreese
Copy link
Contributor Author

nreese commented Jan 7, 2021

@elasticmachine merge upstream

@nreese nreese requested a review from thomasneirynck January 7, 2021 15:11
Copy link
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
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 <[email protected]>
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 <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] Labels for all geometry types
4 participants