-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Implement 'circle-pitch-alignment' property #4871
Conversation
Follows model of 'text-pitch-alignment'. Requested in issue #4120.
I'm not that familiar with use cases for circle layers, but I'm wondering if we even need this property? Are there use cases where |
@nickidlugash I think one common use case is to use I tried changing the style to viewport alignedmap aligned |
Based on this description, I think you're talking about
I think this makes sense. |
This would mean that the default behavior of one of the two properties would have to change, right? I'm pretty sure we don't want the latter, based on #2541. Making circles both align and scale with pitch makes the most sense, but is also technically a breaking change. Probably acceptable for GL JS, but less so the native SDKs. Thoughts? |
Yeah, you're right, I forgot that So: keep it the way it is in this PR, with all four combinations allowed? |
I don't know enough to weigh in on the acceptability of a breaking change here, but I do agree that this combination of defaults seems to make the most sense. @peterqliu do you have opinions on default values for |
I sense that we're early enough in our adoption here that we can do either without too huge a cost 👍
There's a great question here, because circles can be used as both
Since circles are sized in pixels instead of meters, they're poorly adapted to represent round areas in real space, which diminishes the second use case. In this context, I lean toward both scaling and aligning to viewport, by default. |
At one point, we experimented with using circle layers to represent cul-de-sacs (turning circles) in Mapbox Streets. For this use case, the circle is an abstraction of a circular area in physical space. By analogy, line layers represent roadways in Streets even though That said, I agree that circle layers are better suited for point features than area features in general. After all, the cul-de-sac use case doesn’t generalize to much larger areas, for which a real geographic circle geometry is a frequent request (cf. mapbox/mapbox-gl-native#2167). |
That argument makes sense, but reverses our last decision on these defaults... @samanpwbb, since you filed #2541 -- do you think if you were doing the same thing today and found the circles unscaled/pitched by default, it would be straightforward to discover the |
donning the circle-as-point-features lens again, I think a default of |
So it sounds like the leading alternative would be to make scale default to @jfirebaugh If that sounds good to you, could you review the rest of the PR for correctness? If you lean strongly towards the alternative default ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Add new icon-pitch-alignment and circle-pitch-alignment properties mapbox/mapbox-gl-js#4869 mapbox/mapbox-gl-js#4871
Finishing up the style properties requested in #4120.
The combination of
circle-pitch-alignment: map
andcircle-pitch-scaling: viewport
is supported, but it's a bit of an odd combination: in the distance, circles will be "squashed" by the perspective effect but they'll maintain the same width. Because this is an odd choice, it might make sense to add a new (default)auto
option tocircle-pitch-scaling
and make it key off ofcircle-pitch-alignment
?/cc @jfirebaugh @nickidlugash