-
Notifications
You must be signed in to change notification settings - Fork 21
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
add POV and other v1.8, v1.7 changes #277
Conversation
@bcamper This PR is cleaned up and ready for new 👀, please! |
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.
Great new features and I love all the code removal!
There are a few questions around filter logic or values that are worth addressing, may be one or two unintentional items, but otherwise all looks good.
I'd like to pull out a couple of these oft-repeated lines into globals, to be more concise and lower risk of copy-paste errors, such as:
var kind = (global.ux_point_of_view && feature['kind:'+global.ux_point_of_view]) || (global.ux_point_of_view_fallback && feature['kind:'+global.ux_point_of_view_fallback]) || feature.kind;
and
priority: |
function() { return (feature['min_zoom'] + (1 - 1 / feature['collision_rank']) * 0.1) || 65; }
I can take a crack at that.
@@ -5120,6 +5036,19 @@ layers: | |||
color: [0.765,0.765,0.765] | |||
visible: true | |||
|
|||
# # (20190729: nvk) TODO: This should only show when no other kind condition |
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.
I believe this kind of "else" condition can be done with the new exclusive
layer property added in JS -- make all the other layers exclusive
, and if none matches, the non-exclusive "else" one does -- but it's not in ES yet.
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.
YES! exclusive
would be great here :) So in Tangram ES the layer won't match and won't display? Seems backwards compatible and okay to implement?
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.
Reading the docs in tangrams/tangram#705 I'm confused how I'd implement this. Is there a !exclusive
or priority: -1
to mean evaluate this one layer last? Or do I have to add priority to every other sibling layer here, too?
Actually now that I'm looking at these lines like:
I'm realizing the default value of 65 will never be triggered. If What's the desired fallback logic here? |
So is this the desired collision priority logic:
But, even then, the fallback values in the style like 65, 58, etc. don't make sense as final priority values when compared with Are those numbers supposed to be defaults for |
You're right... those fallback values are a holdover from before all the Example:
The outcome should be Feature A wins over B wins over C. I think this could be accomplished by falling back to |
I've addressed the collision priority changes primarily in 92afcab (simplified to remove the defaults), and added logic for road, water, and transit labels (turn transit overlay on to see it in action). |
@bcamper This is ready for another review, please. I've addressed the collision priority stuff you called out (and fixed the transit overlay labels in the process), but don't know how to proceed on the #277 (comment) so maybe we defer that to a later PR? |
(otherwise it'll divide by null rather than falling back to the desired value)
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.
Made an additional fix to the those collision priority functions -- they need to check for null
first, otherwise they'll divide by null
which will be Infinity
instead of falling back to the desired value.
Couple other small questions about things that may have issues, but probably not significant/blocking (please do take a look though).
interactive: false | ||
color: [[13,[0,0,0.5,0.25]],[15,[0,0,0.5,0.8]]] | ||
width: [[11,0.5px],[12,0.8px],[16,1.5px],[18,1.5m]] | ||
# let roads sort themselves past zoom 14 |
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.
This is just assigning an explicit order value though, is the comment incorrect? (or the code?)
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.
bubble-wrap-style.yaml
Outdated
visible: true | ||
color: blue | ||
width: 1.7px | ||
z-none: |
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.
Still wondering about this one.
NVK: Removed in 930a049.
Agree we can follow up on this later. |
Yep that works, made some updates in 8fdfe3b. |
…largest transit stations
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.
I fixed a noticeable regression in the style between prod and this PR by changing order of operations in the collision_priority
function in eafad26, which was preventing neighbourhood labels in SF to show up at zooms less than 16 and was preventing Golden Gate Park label from showing up w/r/t roads labels, and too many "bay" labels north of San Francisco.
aboriginal_lands
boundary line treatmentgenerator
icons to use kind_detail lookupenclosure
labelsdanger_area
andrange
landuse styling (not RED!)labels-11
theme to not reference all the client side hacks that were fixed server side