tangrams / bubble-wrap

Bubble Wrap basemap style
http://tangrams.github.io/bubble-wrap/
MIT License
27 stars 21 forks source link

add POV and other v1.8, v1.7 changes #277

Closed nvkelso closed 5 years ago

nvkelso commented 5 years ago
nvkelso commented 5 years ago

@bcamper This PR is cleaned up and ready for new 👀, please!

bcamper commented 5 years ago

OK I extracted some repetitive logic in:

f591907cbf414cab6beb4538295b53b92ff1705c 91f3b8f294d41bb124942474bf935b6a002b9a6b

Noticing that the pre-existing language toggle stuff could benefit from this as well, but it looks more complicated because of the many variants (short name, left/right borders, etc.), so I'll leave that for now.

bcamper commented 5 years ago

Actually now that I'm looking at these lines like:

priority: |
  function() { return (feature['min_zoom'] + (1 - 1 / feature['collision_rank']) * 0.1) || 65; }

I'm realizing the default value of 65 will never be triggered. If collision_rank is missing, you'll get -Infinity. If min_zoom is missing, you'll still get a number, but less than 1.

What's the desired fallback logic here?

bcamper commented 5 years ago

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 min_zoom based values that are going to be in the ~1-20 range.

Are those numbers supposed to be defaults for collision_rank?

nvkelso commented 5 years ago

You're right... those fallback values are a holdover from before all the collision_rank were moved server side and spread out with much greater detail. But something like this is still desired. If a feature has a min_zoom but no collision_rank then it should be evaluated as worst among peers of the same min_zoom.

Example:

The outcome should be Feature A wins over B wins over C.

I think this could be accomplished by falling back to feature.min_zoom + 0.999 and call it good?

nvkelso commented 5 years ago

I've addressed the collision priority changes primarily in 92afcabb466831752f87ca73d17668dd5b57df8f (simplified to remove the defaults), and added logic for road, water, and transit labels (turn transit overlay on to see it in action).

nvkelso commented 5 years ago

@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 https://github.com/tangrams/bubble-wrap/pull/277#discussion_r311863310 so maybe we defer that to a later PR?

bcamper commented 5 years ago

@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?

Agree we can follow up on this later.

bcamper commented 5 years ago

You're right... those fallback values are a holdover from before all the collision_rank were moved server side and spread out with much greater detail. But something like this is still desired. If a feature has a min_zoom but no collision_rank then it should be evaluated as worst among peers of the same min_zoom. ... I think this could be accomplished by falling back to feature.min_zoom + 0.999 and call it good?

Yep that works, made some updates in https://github.com/tangrams/bubble-wrap/pull/277/commits/8fdfe3be79e87e5bb48e355a7f30c19c5ba14a3d.