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.

Align annotation rotation and pitch with map #2528

Closed

Description

@1ec5

Annotations maintain their perspective even as you rotate and pitch the map. But sometimes you want an annotation to stay fixed, so that it rotates and tilts with the map. A contrived example would be an arrow that points in a particular direction – you’d want the direction to be in sync with the map’s direction.

/cc @incanus @ansis

Activity

  1. incanus commented on Oct 5, 2015

    @incanus
    Contributor

    Meaning symbols, not shapes. Another related issue here is raster ground overlays, as they're called in other frameworks, which work similarly to the not-yet-ported-here video source type — rectangles or other polygons of outside material stuck to the panning, zooming, rotating map.

  2. incanus commented on Oct 5, 2015

    @incanus
    Contributor

    Sorry, I do mean rasters here, not vector-drawn shapes in geo terms as a hack to stick things to the map.

    Here is a good illustrative example from another toolkit:

    ground_overlay_example

  3. ansis commented on Jan 27, 2016

    @ansis
    Contributor

    This can be done internally by setting the "icon-rotation-alignment" style property to "map" instead of the default "viewport". I'm not sure how you want to expose the option though

  4. 1ec5 commented on Jan 27, 2016

    @1ec5
    ContributorAuthor

    If it were just about point annotations, I’d say we could add a rotates property to MGLAnnotationImage. But we don’t have an equivalent interface for overlays, so we’ve been cramming methods into MGLMapViewDelegate for various sundry overlay properties. I’m hesitant to keep doing that.

  5. added
    iOS
    on Jan 27, 2016
  6. aksonov commented on May 30, 2016

    @aksonov

    @1ec5 Could you check that commit nitaliano/react-native-mapbox-gl@bbb7040 ? It adds 'rotatedImage!' with rotation param.

  7. 1ec5 commented on May 30, 2016

    @1ec5
    ContributorAuthor

    nitaliano/react-native-mapbox-gl#280 modifies an MGLAnnotationImage’s image to compensate for the map’s rotation. That approach breaks down as soon as the map is rotated, whether programmatically or due to a user gesture.

    We don’t intend to support this feature for MGLAnnotationImage right now. Instead, we should implement a new property on MGLAnnotationView (#4801) that causes it to ignore the map’s rotation, similar to #5085 and #5067.

    For non-view-backed point annotations, we’re waiting on #837 to enable full styling of arbitrary features on the map; once that works, it’ll be trivial to keep a point annotation from rotating using the approach outlined in #2528 (comment), no transforms needed.

  8. added
    annotations
    on Jun 5, 2016
  9. self-assigned this
    on Jun 5, 2016
  10. added a commit that references this issue on Jun 6, 2016
    151e677
  11. added this to the ios-v3.3.0 milestone on Jun 6, 2016
  12. added a commit that references this issue on Jun 24, 2016
    b195ca4
  13. 2 remaining items

  14. changed the title [-]Fixed annotations[/-] [+]Align annotation rotation and pitch with map[/+] on Jul 8, 2016
  15. added a commit that references this issue on Jul 10, 2016
    8d2bb2d
  16. modified the milestones: ios-future, ios-v3.4.0 on Aug 12, 2016
  17. 1ec5 commented on Aug 31, 2017

    @1ec5
    ContributorAuthor

    For non-view-backed point annotations, we’re waiting on #837 to enable full styling of arbitrary features on the map; once that works, it’ll be trivial to keep a point annotation from rotating using the approach outlined in #2528 (comment), no transforms needed.

    As a workaround, you can now use the runtime styling API (MGLShapeSource and MGLSymbolStyleLayer) to implement something approximating a point annotation whose rotation matches the map. Use the MGLSymbolStyleLayer.iconRotationAlignment property to make the icon’s rotation match the map. #9479 implements an iconPitchAlignment property for matching the map’s pitch; it’ll be in the next release (tentatively versioned v3.7.0).

  18. added
    archived
    on Nov 4, 2018
  19. stale commented on Dec 2, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  20. julianrex commented on Dec 3, 2018

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

Metadata

Metadata

Assignees

Labels

annotationsarchivedfeatureiOS

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions