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

Allow annotation views to lie flat against a tilted map #10498

Closed
1ec5 opened this issue Nov 18, 2017 · 4 comments
Closed

Allow annotation views to lie flat against a tilted map #10498

1ec5 opened this issue Nov 18, 2017 · 4 comments
Labels
annotations Annotations on iOS and macOS or markers on Android archived Archived because of inactivity gl-ios Google Maps parity For feature parity with the Google Maps SDK for Android or iOS iOS Mapbox Maps SDK for iOS

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 18, 2017

MGLAnnotationView should have a tiltsToMatchCamera property to complement the rotatesToMatchCamera property added in #9147. The effect we’re after is similar to what you can accomplish with MGLSymbolStyleLayer.iconPitchAlignment. Courtesy of #5245 (comment), here’s a preview of what it would look like when applied to annotation views:

flattened hydrants

Originally, #5067 introduced a flat property to MGLAnnotationView, off by default, that allowed the view to appear to lie flat against the map as the map tilts. The idea was to match the Google Maps SDK’s GMSMarker.flat property. However, as seen in #5090, all it did was to vertically scale the view, a very different effect.

We backed out the flat option in #5546. #5245 attempted to transform the view the right way to match the map’s transform, but that effort went cold. This issue tracks reviving #5245, in hopes that exposing the map’s transform matrix to the SDK will also enable future improvements for using the SDK with SceneKit.

/cc @fabian-guerra @lilykaiser

@1ec5 1ec5 added annotations Annotations on iOS and macOS or markers on Android Google Maps parity For feature parity with the Google Maps SDK for Android or iOS iOS Mapbox Maps SDK for iOS labels Nov 18, 2017
@1ec5
Copy link
Contributor Author

1ec5 commented Aug 14, 2018

mapbox/mapbox-gl-js#7039 (comment) might be a lead for matching mbgl’s transform matrix. That code is on its face about placing 3D objects in the map scene, but having annotation views lie flat is effectively about treating them as 3D objects as well.

@stale
Copy link

stale bot commented Feb 10, 2019

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

@stale stale bot closed this as completed Feb 10, 2019
@julianrex julianrex removed the archived Archived because of inactivity label Feb 11, 2019
@julianrex julianrex reopened this Feb 11, 2019
@1ec5
Copy link
Contributor Author

1ec5 commented Jul 29, 2019

mapbox/ios-sdk-examples#111 (comment) links to this gist, which calculates the correct transform matrix by reverse-engineering mbgl’s transform matrix with a different axis orientation.

@stale stale bot added the archived Archived because of inactivity label May 20, 2020
@stale
Copy link

stale bot commented May 23, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android archived Archived because of inactivity gl-ios Google Maps parity For feature parity with the Google Maps SDK for Android or iOS iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

3 participants