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.

Support selection of shape and polyline annotations #2082

Closed

Description

@friedbunny

We explicitly don't support selecting non-point annotations in iOS (820d2da), so polylines and polygons aren't particularly interactive yet.

Related: #1504

/cc @incanus @1ec5

Activity

  1. added
    iOS
    on Aug 14, 2015
  2. friedbunny commented on Aug 14, 2015

    @friedbunny
    ContributorAuthor

    I'm unsure where Android stands on annotation selection — @ljbade @bleege?

  3. incanus commented on Aug 14, 2015

    @incanus
    Contributor

    General Android annotation selection has been on my plate over in #1969 but is incomplete.

    As for shapes, I don't think MapKit even supports this, or if it does, I know for a fact it doesn't support callouts on them. We hit this with the raster SDK and it was due to difficult callout placement algorithms. But we could try here?

  4. removed
    iOS
    on Aug 14, 2015
  5. added
    GL JS parity
    on Aug 14, 2015
  6. 1ec5 commented on Aug 14, 2015

    @1ec5
    Contributor

    This would be nice for Leaflet parity.

  7. lucaswoj commented on Aug 14, 2015

    @lucaswoj
    Contributor

    The way this is done in JS is with

    • runtime styling API
    • featuresAt API

    EDIT: AFIK

  8. ljbade commented on Aug 15, 2015

    @ljbade
    Contributor

    You don't necessarily need to support callouts.

    Perhaps just a way to select/hit test polygons.

  9. maciekish commented on Sep 14, 2015

    @maciekish
    Contributor

    We definitely need callout support as well as selection.

  10. Zakay commented on Sep 14, 2015

    @Zakay

    +1 for callout support as well.

  11. incanus commented on Sep 14, 2015

    @incanus
    Contributor

    Would it be acceptable to require the developer to indicate where on a polyline/polygon the callout should attach? That would take the guesswork off of the framework. We could support some simple options like top/bottom/left/right/centroid and leave it at that.

    The problem is when you get into polylines like this — where do you attach the callout?

    file sep 14 8 36 35 am

    Prior art: mapbox/DEPRECATED-mapbox-ios-sdk#285

  12. maciekish commented on Sep 14, 2015

    @maciekish
    Contributor

    Definiteyly, that's a lot better than not being able to do it at all!

  13. mb12 commented on Sep 14, 2015

    @mb12

    @incanus The callout for line can be attached to a 'point on the line' that passed the hit-test for tap.

  14. friedbunny commented on Sep 14, 2015

    @friedbunny
    ContributorAuthor

    The callout for line can be attached to a 'point on the line' that passed the hit-test for tap.

    Aye, tapped-point would be the most intuitive solution for polyline callouts. Polygons, seems like centroid would be best?

  15. 21 remaining items

  16. removed
    Android
    on Jul 7, 2017
  17. modified the milestones: ios-future, ios-v3.6.1 on Jul 10, 2017
  18. CodeKunal commented on Aug 3, 2017

    @CodeKunal

    Hi
    I have my own CustomPolygonFeature subclass

    class CustomPolygonFeature: MGLPolygonFeature {
    var fillColor: UIColor?
    var strokeColor:UIColor?
    var name:String?
    }

    I am adding these polygons on top of mapView using .add(Overlay:) method
    I have added a tapGesture on the mapView. When I click on tap I am checking the type of Feature I clicked on.

    let spot = gesture.location(in: mapView)
    let features = mapView.visibleFeatures(at: spot)
    features.map{
    print(type(of: $0))
    }

    I am expecting the result to be
    Print:CustomPolygonFeature
    Actual result:
    Prints: MGLPolygonFeature

    Is there anything wrong?

  19. modified the milestones: ios-v3.6.3, ios-v3.6.2 on Aug 24, 2017
  20. 1ec5 commented on Sep 8, 2017

    @1ec5
    Contributor

    @CodeKunal, this is an inherent limitation of the feature querying APIs and runtime styling in general: #6178. In #9540, we amended the documentation to note this limitation.

  21. removed this from the ios-v3.6.3 milestone on Sep 18, 2017
  22. 1ec5 commented on Dec 20, 2017

    @1ec5
    Contributor

    This feature was implemented for in #9984, which is in iOS map SDK v3.7.0 and will be in macOS SDK v0.6.0 shortly.

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

Metadata

Metadata

Assignees

Labels

MapKit parityfeatureiOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions