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.

iOS annotation views #1784

Closed
Closed

Description

@incanus

Our current iOS user dot is a custom view (made of three parts; the dot and, mutually exclusively, either the pulsing halo or the accuracy radius).

ios simulator screen shot jun 23 2015 3 39 49 pm

We also do this with the (singular) callout view:

ios simulator screen shot jun 23 2015 3 40 25 pm

Though we currently punt on tracking this callout view to the map pan/zoom since there are margin and layout issues that are more complex than the mere user dot.

We eventually want to support other, user-provided views atop the GL map view for several reasons:

  • Users are already creating views in projects and want to use them on maps.
  • Follows expected MapKit APIs.
  • Allows use of existing libraries expecting to work with views such as kingpin (related: point clustering #320).
  • Native views allow animatability with Cocoa APIs (CABasicAnimation, UIView animation blocks, etc.)

Somewhat blocked by / could be improved upon with #1125, which I think is at the core of a successful implementation.

Tasks:

  • Memory-efficient reuse identifier-based queueing approach for view vending from delegate (-[MGLMapViewDelegate mapView:viewForAnnotation:], -[MGLMapView dequeueReusableAnnotationViewWithIdentifier], etc.)
  • Improved syncing/tracking performance in improve synced view tracking #1125 as mentioned above, including research into possible frame-based view/layer OpenGL compositing/texture uploading.
  • Branching current tap gesture hit testing to account for native-side views as well as core-side symbols.

Activity

  1. added
    iOS
    on Jun 23, 2015
  2. added this to the iOS Beta 3 milestone on Jun 23, 2015
  3. 1ec5 commented on Jun 23, 2015

    @1ec5
    Contributor

    This is a good opportunity to pick #1582 back up as well.

  4. incanus commented on Jun 23, 2015

    @incanus
    ContributorAuthor

    👍

  5. added a commit that references this issue on Jun 24, 2015
  6. incanus commented on Jun 24, 2015

    @incanus
    ContributorAuthor

    Branching current tap gesture hit testing to account for native-side views as well as core-side symbols.

    Actually, this might not be necessary as long as the size of native-side views is taken into account, as hit testing can work the same way.

  7. incanus commented on Jul 7, 2015

    @incanus
    ContributorAuthor

    Based on what I'm seeing with #941, we may be able to punt on this for b3 and just benefit from custom marker imagery there and a better user dot and callout from #1125. It would definitely keep hit testing simple and not have problematic z-ordering between iOS-side views and GL-side sprites, and using what I learned in #1125 (comment) we could keep this all GL-side even when using UIView for b4.

  8. incanus commented on Jul 7, 2015

    @incanus
    ContributorAuthor

    Pushing this off of b3 to keep things simple, as well as keep us in platform-independent territory a bit longer. We'll hit it right & performant out of the gate for b4.

  9. removed this from the iOS Beta 3 milestone on Jul 7, 2015
  10. maxneust commented on Aug 10, 2015

    @maxneust

    @incanus Any ETA for when will this be implemented? The only thing keeping us from moving to Mapbox-gl is custom views for annotations/callouts. Thanks!

  11. mackuba commented on Aug 25, 2015

    @mackuba

    I'd also be interested in this - I'm migrating my app from MBXMapKit right now, and I have a "pulsating dot" custom view there very similar to the one described above that I use for map markers.

  12. mackuba commented on Aug 26, 2015

    @mackuba

    Also, once you add support for views, something like map.viewForAnnotation(annotation) would be nice, because I need to access existing annotation views on the map and rotate them in some cases.

  13. pecheriere commented on Oct 20, 2015

    @pecheriere

    Hey @incanus, do you have any news about this ?

  14. gpbl commented on Nov 16, 2015

    @gpbl

    I also need to use a custom view for the user location annotation. I tried to subclass MGLMapView but many internals seems to be only accessible by the MGLMapView instance itself.

  15. 6 remaining items

  16. devcarlos commented on Mar 22, 2016

    @devcarlos

    Is this going to be implemented someday ? We have only decided to use MapBox because of the Dark/Light custom styles and the Annotation cannot be as flexible as the map? Really ? Very disappointed so far and thinking to stay with MapKit after all.

    At least you should give some hints to create an MGLAnnotationImage with custom texts like title, subtitle or similar.

  17. 1ec5 commented on Mar 22, 2016

    @1ec5
    Contributor

    Yes, this issue is on the 3.3.0 milestone. The implementation depends on #4384 and would likely progress in tandem with #4392.

    In the meantime, the iosapp demo application has some code you can crib for rendering text onto an annotation image. It looks like this:

    annotation images

  18. devcarlos commented on Mar 22, 2016

    @devcarlos

    Thanks @1ec5 I was going to try the same (take a UIView snapshot) with my Map Pin icon as background and the Title text required.

    Regards,
    Carlos

  19. 1ec5 commented on Apr 12, 2016

    @1ec5
    Contributor

    The Android analogue to this issue is #3276.

  20. added
    macOS
    on Apr 12, 2016
  21. postmechanical commented on Apr 12, 2016

    @postmechanical

    @1ec5 Any progress on this issue? Is there a branch for it yet?

  22. 1ec5 commented on Apr 12, 2016

    @1ec5
    Contributor

    Hey @postmechanical, we’re just getting started on this issue today. We’re starting with #4384, as that’ll be critical for performance. Performance-wise, there’s also the approach @incanus took in #1125 (comment), but we aren’t planning to revisit that optimization until we’ve got the basic API up and running.

  23. mmccroskey commented on Apr 14, 2016

    @mmccroskey

    Hi @1ec5 -- I work with @postmechanical and was wondering if there were any updates you guys could offer on this one?

  24. boundsj commented on Apr 14, 2016

    @boundsj
    Contributor

    Hi @mmccroskey as @1ec5 said above, we are just getting started on this. I will make a PR in the coming days but I don't have an exact ETA on when this feature will be completed. As @1ec5 mentioned, you can monitor #4384 (and this ticket) for updates as they happen.

    cc @twbell

  25. mmccroskey commented on Apr 14, 2016

    @mmccroskey

    Sounds good, thanks @boundsj

    cc @postmechanical

  26. 1ec5 commented on Apr 18, 2016

    @1ec5
    Contributor

    For future reference, the experimental performance optimization described in #1125 (comment) is on the view-based-points branch.

  27. removed
    macOS
    on May 14, 2016
  28. 1ec5 commented on May 14, 2016

    @1ec5
    Contributor

    MGLAnnotationView landed on iOS in #4801. Opened #5035 to track porting it to OS X.

  29. 1ec5 commented on May 14, 2016

    @1ec5
    Contributor

    Our current iOS user dot is a custom view (made of three parts; the dot and, mutually exclusively, either the pulsing halo or the accuracy radius).

    Filed #5039 to base the user dot on the annotation view class.

    I also need to use a custom view for the user location annotation.

    Filed #5037 to add a way for you to specify the user location annotation’s view.

    Filed some more issues for tail work: #5036 #5038 #5040.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureiOS

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions