You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Align annotation rotation and pitch with map #2528
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.
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.
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
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.
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.
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).
Activity
incanus commentedon Oct 5, 2015
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
videosource type — rectangles or other polygons of outside material stuck to the panning, zooming, rotating map.incanus commentedon Oct 5, 2015
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:
ansis commentedon Jan 27, 2016
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
1ec5 commentedon Jan 27, 2016
If it were just about point annotations, I’d say we could add a
rotatesproperty toMGLAnnotationImage. 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.aksonov commentedon May 30, 2016
@1ec5 Could you check that commit nitaliano/react-native-mapbox-gl@bbb7040 ? It adds 'rotatedImage!' with rotation param.
1ec5 commentedon May 30, 2016
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.
[ios] Annotation view degrees of freedom
[ios] Annotation view degrees of freedom
2 remaining items
[-]Fixed annotations[/-][+]Align annotation rotation and pitch with map[/+][ios] Annotation view degrees of freedom
1ec5 commentedon Aug 31, 2017
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.iconRotationAlignmentproperty to make the icon’s rotation match the map. #9479 implements aniconPitchAlignmentproperty for matching the map’s pitch; it’ll be in the next release (tentatively versioned v3.7.0).stale commentedon Dec 2, 2018
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
julianrex commentedon Dec 3, 2018
/cc @fabian-guerra