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.

mbgl::AnnotationManager should use mapbox::geometry types #5158

Closed

Description

@1ec5

mbgl::AnnotationManager should use the mapbox::geometry types that are being used e.g. as return values for mbgl::Map::queryRenderedFeatures() (#5066). This would give us the ability to add any kind of geometry to the annotation layer, unblocking #1729.

/cc @jfirebaugh

Activity

  1. added
    Core
    annotations
    on May 26, 2016
  2. jfirebaugh commented on May 26, 2016

    @jfirebaugh
    Contributor

    In 3f17b63 and 30ec9c6 I sketched out a couple potential redesigns that accomplish this. I think I slightly prefer the latter.

    Both designs will be significantly easier to implement once mapbox/geojson-vt-cpp#45 lands. Currently a bunch of conversion code would be required.

  3. 1ec5 commented on May 26, 2016

    @1ec5
    ContributorAuthor

    I think I’d prefer the latter option too. It wouldn’t feel right to restrict this API to just the three geometry types (point, line, polygon) in core, given that core can actually handle any of the geometry types.

  4. self-assigned this
    on May 26, 2016
  5. jfirebaugh commented on May 26, 2016

    @jfirebaugh
    Contributor

    The above approach expands into much more work than I'm comfortable biting off right now, given the release schedule and certainty of introducing conflicts with #4839.

    We can switch the interface to geometry.hpp types with less effort: https://github.com/mapbox/mapbox-gl-native/compare/5158-minimal. Note that this approach does not itself fix #1729 or even expand the actual range of supported geometry types. Unsupported types become a runtime error, rather than not being expressible in the API.

    @1ec5 WDYT?

  6. jfirebaugh commented on May 26, 2016

    @jfirebaugh
    Contributor

    Actually, it shouldn't be hard to expand the geometry support to polygon holes, MultiLineString, and MultiPolygon. What looks difficult is Point, MultiPoint, and GeometryCollection.

  7. 1ec5 commented on May 27, 2016

    @1ec5
    ContributorAuthor

    Is Point difficult because point annotations and shape annotations have different tile and layer implementations?

  8. jfirebaugh commented on May 27, 2016

    @jfirebaugh
    Contributor
    • A line or fill layer -- the only options for ShapeAnnotation -- displaying a single Point isn't a useful combination. It won't render anything.
    • A line or fill layer displaying a MultiPoint isn't particularly sensical. I think it will render the same as a LineString with the same coordinates, so you might as well just use that.
    • The version of geojson-vt-cpp currently in use privatizes the method we'd want to use for conversion.
  9. jfirebaugh commented on May 27, 2016

    @jfirebaugh
    Contributor

    We could however, switch PointAnnotation from LatLng to Point<double>, if that would help the SDKs with consistency.

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

Metadata

Metadata

Assignees

Labels

Coreannotationsrefactor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions