Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Shape annotation z-order is reversed #5691

Closed
1ec5 opened this issue Jul 14, 2016 · 1 comment · Fixed by #5710
Closed

Shape annotation z-order is reversed #5691

1ec5 opened this issue Jul 14, 2016 · 1 comment · Fixed by #5710
Assignees
Labels
annotations Annotations on iOS and macOS or markers on Android bug Core The cross-platform C++ core, aka mbgl
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jul 14, 2016

We have a proof-of-concept application that draws an arrow on a route line at the location of each maneuver. Because the arrow’s stem must follow the path of the route even as it twists and winds, the arrow is implemented as a couple of polylines instead of a point annotation or annotation view. Because a polyline can only be stroked, not outlined, we’ve implemented the arrow as two similar pairs of polylines, a thinner, white pair of polylines atop a thicker, blue pair.

Here’s a patch to iosapp and macosapp that draws the arrow the way this proof-of-concept application does. This is what it’s supposed to look like, seen here in aa1a54c (ignore the fact that it’s backwards):

aa1a54c

8985b13 introduced a regression that incorrectly closed each polyline:

cfd6757

0fba70d introduced another regression that reversed the z-order of the polylines:

0fba70d

As of 44406e9, the polyline-closing bug has been fixed, but the z-order bug remains:

master

In some cases, we’ve seen mixed behavior:

screen shot 2016-07-11 at 6 59 18 pm

What should happen is that each added annotation is drawn above the annotation that was added before it.

/ref #5200
/cc @jfirebaugh

@1ec5 1ec5 added bug Core The cross-platform C++ core, aka mbgl annotations Annotations on iOS and macOS or markers on Android labels Jul 14, 2016
@1ec5 1ec5 added this to the ios-v3.3.1 milestone Jul 14, 2016
@1ec5 1ec5 self-assigned this Jul 14, 2016
@jfirebaugh
Copy link
Contributor

I think prior z-ordering behavior of shape annotations was mostly accidental rather than an intentional API contract, but I can see how it's desirable. I bet reverting these unordered_maps to map would restore the prior behavior.

1ec5 added a commit that referenced this issue Jul 16, 2016
Shapes are once again always added to the top z-index.

Fixes #5691.
1ec5 added a commit that referenced this issue Jul 18, 2016
Shapes are once again always added to the top z-index.

Fixes #5691.
1ec5 added a commit that referenced this issue Jul 18, 2016
Shapes are once again always added to the top z-index.

Fixes #5691.

Cherry-picked from 74fe96d.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android bug Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants