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

Polyline and markers drawn underneath road in Streets style #3037

Closed
tomtaylor opened this issue Nov 15, 2015 · 13 comments
Closed

Polyline and markers drawn underneath road in Streets style #3037

tomtaylor opened this issue Nov 15, 2015 · 13 comments
Assignees
Labels
Milestone

Comments

@tomtaylor
Copy link

I've just built CityCyclist against c35f18f, and I managed to get it into a situation, shortly after launch, where the route polyline and marker were drawn underneath the roads, but above the background colour. I quit and restarted and the issue went away, and I can't reproduce it again.

img_9536

@friedbunny friedbunny added the bug label Nov 16, 2015
@friedbunny
Copy link
Contributor

Interesting! /cc @jfirebaugh

@jfirebaugh
Copy link
Contributor

Looks like this bug can happen when annotations are added before the style finishes loading. In that scenario, it's possible for the annotation layers to get added first, and then when the style JSON loads, the style layers get appended.

@tomtaylor
Copy link
Author

@jfirebaugh that seems likely in this situation. Is it possible to serve the style JSON locally to reduce the likelihood of this?

@friedbunny
Copy link
Contributor

Loading styles locally is broken (#3050) at the moment.

@Zakay
Copy link

Zakay commented Nov 18, 2015

I have been rolling back commit after commit to find the one that caused this issue, and I found a candidate: f9ebe54 @jfirebaugh

@Zakay
Copy link

Zakay commented Nov 18, 2015

This happens also when adding annotations after loading the map.

@Zakay
Copy link

Zakay commented Nov 19, 2015

@jfirebaugh I've updated to latest and still get this issue, but much less now. I have re-place an annotation by long-press on the map. The annotation is sometimes visible and sometimes not. And again rolling back to older commits before f9ebe54 then this works.

@tomtaylor
Copy link
Author

Yeah, I also managed to get an invisible annotation that became visible when I removed and readded it.

On Thu, 19 Nov 2015, at 14:11, Zakay wrote:

@jfirebaugh I've updated to latest and still get this issue, but much less now. I have re-place an annotation by long-press on the map. The annotation is sometimes visible and sometimes not.


Reply to this email directly or view it on GitHub:
#3037 (comment)

@Zakay
Copy link

Zakay commented Nov 19, 2015

To reproduce modify handleLongPress on the demo app to remove other annotations.
And then randomly place dropped pins on the map.

It's tiresome but sometimes it happens a lot and sometimes you need to give in some time.

This issue is the only blocking issue we have left before releasing a major version of our app, and really look forward to have this fixed. Rolling back is no option as latest commits also have fixed serious crashing issues we've had.

- (void)handleLongPress:(UILongPressGestureRecognizer *)longPress
{

    if (longPress.state == UIGestureRecognizerStateBegan)
    {
        MGLPointAnnotation *point = [MGLPointAnnotation new];
        point.coordinate = [self.mapView convertPoint:[longPress locationInView:longPress.view]
                                 toCoordinateFromView:self.mapView];
        point.title = @"Dropped Marker";
        point.subtitle = [NSString stringWithFormat:@"lat: %.3f, lon: %.3f", point.coordinate.latitude, point.coordinate.longitude];

        [self.mapView removeAnnotations:self.mapView.annotations];

        [self.mapView addAnnotation:point];
        [self.mapView selectAnnotation:point animated:YES];
    }
}

850637981_15152414392574149406
851333090_478228348502922907
850632842_5503142534887511869

@friedbunny friedbunny mentioned this issue Nov 19, 2015
jfirebaugh added a commit that referenced this issue Nov 20, 2015
The previous fix resulted in annotations sometimes never being added.
This would happen if, during the execution of MapContext::update where 
Update::Annotations was set, the style itself was loaded but some of
its subresources (sprite or sources) were not.

#3082 is a follow up issue to make MapContext::update less error-prone.
jfirebaugh added a commit that referenced this issue Nov 20, 2015
The previous fix resulted in annotations sometimes never being added.
This would happen if, during the execution of MapContext::update where
Update::Annotations was set, the style itself was loaded but some of
its subresources (sprite or sources) were not.

#3082 is a follow up issue to make MapContext::update less error-prone.
@jfirebaugh
Copy link
Contributor

Please try out afa04de (master) or 462af73 (release-ios-v3.0.0) -- I believe that resolves the remaining issue.

@Zakay
Copy link

Zakay commented Nov 20, 2015

@jfirebaugh This seems to fix the case I mentioned in above post (re-adding an annotation when tile layer is fully loaded).

But can happen still when tile layer hasn't yet loaded fully. I have a test case, where I switch tile layer, and remove and re-add annotations. These annotations are now hidden and were not before.

(Its not related to this issue #1488, as I have a patch locally to re-add sprites to the spritestore when they are missing as an dirty fix until #1488 is fixed)

@jfirebaugh
Copy link
Contributor

@Zakay, the original issue here is fixed. Can you please file a new issue, and include your test case?

@Zakay
Copy link

Zakay commented Nov 23, 2015

@jfirebaugh just got it working with removing and re-adding them with our own local patch. We of course look forwards remove our own patch when #1488 is fixed. Thanks for your solving this issue so quickly! Going to submit to Apple today, major release!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants