-
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
Complete set of *-rotation-alignment, *-pitch-alignment, and *-pitch-scale properties #4120
Comments
From @yhahn on June 9, 2016 15:40 👍 this makes total sense to me. It's worth noting that atm our renderers don't support this fully but it's something we can work toward. master gl js/native
unskew gl js/native
I'll sketch this property out in the |
Yup! I'd prefer that to designing our spec to around present partial renderer support. |
From @1ec5 on June 9, 2016 16:51 I’m implementing something similar for view-backed annotations on iOS in mapbox/mapbox-gl-native#5245. These properties will make it possible for gl-native to eventually support the same effects for GL point annotations too. |
From @johnnyluu on June 20, 2016 1:0 Dear devs, is there a way for me to implement circle-pitch-alignment at the moment? I need some radius indicator on the map but the circles I added align with the viewport when I add pitch to the map, as shown in the image. |
From @yeldarby on August 17, 2016 21:31 @johnnyluu - if you are looking for a workaround, defining a polygon with GeoJSON instead of using the Mapbox-defined Circle works pretty well. Here is the function I wrote to generate the GeoJSON Polygon
You can use it like this:
If you need to update the circle you created later you can do it like this (note the need to grab the
|
From @princeofnaxos on October 22, 2016 5:33 +1 |
For Implementing these two properties would be helpful for good labeling of pitched maps (currently many scaled labels are much too small to be legible, and the smaller scale causes undesirable increases in label density), but my instinct is that having no scaling at all would also not be visually ideal in many cases. I think having some scaling is helpful to reinforce the perception of a pitched map, as well as for hierarchy (generally, closer labels are more critical). Also, with no scaling I think too many labels along lines may not get placed, due to label lengths exceeding maximum placement size, and glyph placement angles exceeding text-max-angle on curved lines. If this sounds like a reasonable suggestion, I can work on testing it out on a branch. |
@nickidlugash I like that idea! It might be tricky from a style spec perspective because we don't currently have a good way to handle style spec properties that support multiple types. If the prototype is promising, I'm sure we can find a way to make this jive with the spec! Prototype away! |
The hard part of doing this is figuring out how to handle label collisions. The challenge is that when we build the collision tile we don't know ahead of time how far away the tile will be from the viewport (and different labels may respond differently to the distance). One relatively simple solution would be to make all pan operations on tilted tiles using
As an alternative, we could try to do a kind of hacky conservative heuristic collision detection. When calculating the collision box for a tilted tile, we'd treat all symbols as if they had the maximum @nickidlugash Would "labels for a tile are collision detected based on the biggest /cc @anandthakker |
@ChrisLoer Re: downsides to making pan operations on tilted tiles using Re: heuristic-based approach described above, if all symbol collision boxes get calculated based on the largest
I think in general, some degree of heuristic behavior applied to collision detection is fine from a user perspective. We do a bunch already, between hacks like the current pitch-alignment calculations, to our general strategy of calculating collision boxes once per zoom level (which makes sense but isn't necessarily obvious behavior to users). I think most of our users are either unaware of the concept of collision detection (hence why blog posts like this one are useful), or they are generally aware but don't have detailed understanding of how it works. For most users, I think the ideal experience is to not have to think about collisions at all. While we have style spec properties related to collisions, I think users mainly only use them if they notice something that isn't visually ideal, i.e. the "if it ain't broke don't fix it" approach :P Others may feel differently, but I think it's fine to just aim for an approach that 1. gives the best overall results by default for as many users as possible and 2. maintains the integrity of the collision-related style spec properties (e.g. increasing Whether this specific heuristic would be too much of a constraint, I think it would be fine. I'm trying to imagine use cases where someone would want to mix very different FWIW, I actually think heuristics along these lines might actually be beneficial for overall label density. One of the reasons |
Good to see you working on this @ChrisLoer. One use case is to draw a shadow below a symbol marker by using a circle with blur and pitch alignment map, which should work well for 3D maps designed to look like https://www.mapbox.com/blog/3d-leaflet/. |
After experimenting with various
@andrewharvey This is all pretty tangential to the marker-shadow use case you provided (I think |
Follows model of 'text-pitch-alignment'. Requested in issue #4120.
Follows model of 'text-pitch-alignment'. Requested in issue #4120.
These are all finished in GL JS! 🎉 Ports to gl-native are underway. |
Dear devs, I'm not sure if this is a good place to ask.. but my question is related to pitch values in mapbox. Is there a way to add the pitch of a map into the calculation of the projection of X and Y when that is done externally (for example with D3.js)? If the value is too high (like 60 degrees) x and y are not projected completely correct. Thanks! |
this post saved me! |
why dont have a |
Full set of properties:
icon-rotation-alignment
icon-pitch-alignment
-- Addicon-pitch-alignment
property #4869 / Porticon-pitch-alignment
property mapbox-gl-native#9345Removed in favor of hardwired 50% scaling factoricon-pitch-scale
text-rotation-alignment
text-pitch-alignment
Removed in favor of hardwired 50% scaling factortext-pitch-scale
circle-pitch-alignment
-- Add "circle-pitch-alignment" style property #2420 / Implement 'circle-pitch-alignment' property #4871 / Port 'circle-pitch-alignment' property mapbox-gl-native#9349circle-pitch-scale
-- Add support for circle-pitch-scale property #2821 / Add support for circle-pitch-scale property mapbox-gl-native#5576From @lucaswoj on June 9, 2016 15:28
The style spec has the concept of
rotation-alignment
which specifies how features are placed with respect to map rotation.rotation-alignment: viewport
indicates that features should be rotated with respect to the viewport, drawn such that the top of the screen is "up".rotation-alignment: map
indicates that features should be rotated with respect to the map, drawn such that north is "up"I propose that we add the concept of
pitch-alignment
which specifies how features are placed with respect to map pitch.pitch-alignment: viewport
indicates that features should be pitched with respect to the viewport, drawn on plane of the viewport.pitch-alignment: map
indicates that features should be pitched with respect to the map, drawn on plane of the map.cc @yhahn @mourner @tmcw @ansis @jfirebaugh @lbud
Copied from original issue: mapbox/mapbox-gl-style-spec#459
The text was updated successfully, but these errors were encountered: