-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Align annotation rotation and pitch with map #2528
Comments
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 |
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 |
@1ec5 Could you check that commit nitaliano/react-native-mapbox-gl@bbb7040 ? It adds 'rotatedImage!' with rotation param. |
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. |
Replaced MGLAnnotationView’s flat property with a freeAxes property that allows 0–2 degrees of freedom (pitch and/or rotation). Reformatted and copyedited MGLAnnotationView documentation. Removed the unnecessary custom getter on scalesWithViewingDistance. Fixes #2528.
Replaced MGLAnnotationView’s flat property with a freeAxes property that allows 0–2 degrees of freedom (pitch and/or rotation). Reformatted and copyedited MGLAnnotationView documentation. Removed the unnecessary custom getter on scalesWithViewingDistance. Fixes #2528.
Replaced MGLAnnotationView’s flat property with a freeAxes property that allows 0–2 degrees of freedom (pitch and/or rotation). Reformatted and copyedited MGLAnnotationView documentation. Removed the unnecessary custom getter on scalesWithViewingDistance. Fixes #2528.
Replaced MGLAnnotationView’s flat property with a freeAxes property that allows 0–2 degrees of freedom (pitch and/or rotation). Reformatted and copyedited MGLAnnotationView documentation. Removed the unnecessary custom getter on scalesWithViewingDistance. Fixes #2528.
Replaced MGLAnnotationView’s flat property with a freeAxes property that allows 0–2 degrees of freedom (pitch and/or rotation). Reformatted and copyedited MGLAnnotationView documentation. Removed the unnecessary custom getter on scalesWithViewingDistance. Fixes #2528.
Replaced MGLAnnotationView’s flat property with a freeAxes property that allows 0–2 degrees of freedom (pitch and/or rotation). Reformatted and copyedited MGLAnnotationView documentation. Removed the unnecessary custom getter on scalesWithViewingDistance. Fixes #2528.
Replaced MGLAnnotationView’s flat property with a freeAxes property that allows 0–2 degrees of freedom (pitch and/or rotation). Reformatted and copyedited MGLAnnotationView documentation. Removed the unnecessary custom getter on scalesWithViewingDistance. Fixes #2528.
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 |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
/cc @fabian-guerra |
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
The text was updated successfully, but these errors were encountered: