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

No annotations at initial zoom level #1675

Closed

Description

@1ec5

If you follow the “First steps with Mapbox GL for iOS” guide, you wind up initializing an MGLMapView, centering it on the U.S. President’s front yard, and placing an annotation there, all within -[ViewController viewDidLoad]. But if you do all that in -viewDidLoad, the annotations fail to display at the initial zoom level. They appear when you zoom in or out to a different zoom level and disappear when you reenter the initial zoom level.

At launch, the map view happens to show z15 tiles:

initial

Then zoom in, right to the cusp of z16:

in

And zoom in just a little farther to z17:

inner

Or zoom out, right to the cusp of z14:

out

And a little further out to 14:

outer

The upshot is that our guide does not work as designed. We didn’t catch this issue in development because the iOS demo app only adds annotations in response to an action sheet button, not within -viewDidLoad.

Reproduces in ios-v0.3.1 as well as master, regardless of style.

/cc @incanus

Activity

  1. added
    iOS
    on Jun 2, 2015
  2. incanus commented on Jun 2, 2015

    @incanus
    Contributor

    Likely the same issue as #1279.

  3. 1ec5 commented on Jun 3, 2015

    @1ec5
    ContributorAuthor

    Because of this issue, bsudekum/react-native-mapbox-gl’s -[RCTMapboxGL setAnnotations:] has to defer the call to -addAnnotations: or -removeAnnotation:.

    /cc @bsudekum

  4. added this to the iOS Beta 3 milestone on Jun 15, 2015
  5. incanus commented on Jun 15, 2015

    @incanus
    Contributor

    Let's hit this as part of our focus on annotation solidification in b3.

  6. friedbunny commented on Jun 18, 2015

    @friedbunny
    Contributor

    Trying to draw a shape annotation in viewDidLoad immediately after map initialization fails to render the shape on the map, too.

    Here's a GeoJSON polyline demo for iOS using the same delay technique as react-native-mapbox-gl.

  7. self-assigned this
    on Jun 29, 2015
  8. ansis commented on Jul 1, 2015

    @ansis
    Contributor

    @1ec5 I think this should be fixed by the fix-1675 branch. Can you check?

    @tmpsantos do these partial parsing changes look right? 5f90c60

  9. 1ec5 commented on Jul 1, 2015

    @1ec5
    ContributorAuthor

    @ansis, yes, that fixes it. Thanks!

  10. added a commit that references this issue on Jul 1, 2015
    0cd4121
  11. ansis commented on Jul 2, 2015

    @ansis
    Contributor

    This was also fixed by @jfirebaugh's work that merged yesterday

  12. tmpsantos commented on Jul 2, 2015

    @tmpsantos
    Contributor

    @tmpsantos do these partial parsing changes look right? 5f90c60

    Perfect.

  13. 42 remaining items

  14. incanus commented on Sep 21, 2015

    @incanus
    Contributor

    OTOH, I think shape tiles behave differently from point tiles, since shape tiles are actually generated by geojson-vt so that it can simplify shapes as well as trivially create tiles which are wholly inside filled polygons.

    I can get back into this shortly and try to provide more details after reviewing the code a bit.

  15. added 4 commits that reference this issue on Nov 6, 2015
    a1656a5
    00ca1f7
    eb83787
    eb9fcd8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugiOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions