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

Confirm behavior of symbol-placement: point and LineStrings #3808

Open
jfirebaugh opened this issue Dec 15, 2016 · 6 comments
Open

Confirm behavior of symbol-placement: point and LineStrings #3808

jfirebaugh opened this issue Dec 15, 2016 · 6 comments
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

Comments

@jfirebaugh
Copy link
Contributor

Currently, a symbol layer using symbol-placement: point renders a symbol for only the first coordinate pair in a LineString (see e.g. this test case).

Is this the intended behavior? It would seem more logical to render a symbol for each point in the LineString (or MultiLineString).

@lucaswoj
Copy link
Contributor

This behaviour has not been explicitly specified or tested until recently.

Consistency between symbol placement and circle placement is desirable. This would be most easily acheived by adding a new symbol-placement: centroid mode.

@jfirebaugh
Copy link
Contributor Author

I agree that this extends to circle layers as well, and the two should have equivalent placement behavior.

Can you say more about what the behavior of symbol-placement: centroid would be, and how it relates to the OP here (symbol-placement: point with LineStrings)?

@lucaswoj
Copy link
Contributor

lucaswoj commented Dec 15, 2016

Quick table to clarify my point about centroids:

circle symbol w/ point placement
Point geometry placed at vertex placed at vertex
LineString geometry placed at every vertex placed at first vertex
Polygon geometry placed at every vertex placed at centroid

To get the placement of circles to match the placement of symbols in point placement mode, we'd need to replace the "placed at centroid" behaviour with "placed at every vertex" behaviour.

I'd advocate for keeping the "placed at centroid" behaviour available under a symbol-placement: centroid mode.

@mourner
Copy link
Member

mourner commented Dec 15, 2016

@lucaswoj an alternative suggestion from me is to have point mean centroid for all types. This means:

circle symbol w/ point placement
Point geometry placed at vertex placed at vertex
LineString geometry placed at line centroid placed at line centroid
Polygon geometry placed at polygon centroid placed at polygon centroid

I think this is more intuitive and generally more useful. For the previous behavior, I'd expect people to use different geometry types (e.g. multipoint).

@jfirebaugh
Copy link
Contributor Author

By centroid, do you mean "pole of inaccessibility"? My proposal would be either of these two:

circle, or symbol w/ point placement
Point geometry placed at vertex
LineString geometry placed at midpoint
Polygon geometry placed at PoI

or

circle, or symbol w/ point placement
Point geometry placed at vertex
LineString geometry placed at each vertex
Polygon geometry placed at PoI

@lucaswoj
Copy link
Contributor

By centroid, do you mean "pole of inaccessibility"?

Yup. I've been incorrectly using the term centroid. ("pole of inaccessibility" is so long and "POI" is so overloaded 😬)

My proposal would be either of these two

Those both look good.

@ansis Do you remember the motivation behind #2027? Curious if there are any important use cases for the current circle behaviour.

@anandthakker anandthakker added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
Projects
None yet
Development

No branches or pull requests

4 participants