UserLocation/ Camera: not able to set vertical alignment of position
See original GitHub issueDescribe the bug
Old version had a MapView
property to set the userLocationVerticalAlignment
.
Camera
/ UserLocation
seem to have shed that property.
Camera
does indeed has an interface for alignment
,
however it didn’t seem to be finished and is also not passed through to the native side.
To Reproduce
Try using the alignment
property on Camera
.
Notice, that the UserLocation
will still be dead center on the MapView instead of on the bottom or top part of the map.
Expected behavior
Using the alignment
property will move the UserLocation
either to the top or bottom part of the map
Screenshots na
Versions (please complete the following information):
- Platform: Android/ iOS
- Device: Android LGQ7
- Emulator/ Simulator: no
- OS: Android/ iOS
- SDK Version: irrelevant
- React Native Version: 0.61.5
Additional context na
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
UserLocation/ Camera: not able to set vertical alignment of ...
Try using the alignment property on Camera . Notice, that the UserLocation will still be dead center on the MapView instead of on...
Read more >Vertical align table-cell don't work with position absolute
The text should be placed in the middle of my "table cell". Everything works as expected until I add "position: absolute". Now it...
Read more >Location - Android Developers
Constant used to specify formatting of a latitude or longitude in the form ... Returns true if this location has a vertical accuracy,...
Read more >Create overlays in your prototypes - Figma Help Center
Note: You can't set a different position for the new overlay. Figma places the new overlay in the same position as the original...
Read more >vertical-align - CSS: Cascading Style Sheets - MDN Web Docs
The vertical-align CSS property sets vertical alignment of an inline, inline-block or table-cell box.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @dorthwein, yeah, it does exactly what the docs say (if I’ve only read them earlier 😛)
This is how I use it to offset from the top, which will move everything further down.
contentInset={[400, 0, 0, 0]}
Edit: This is on Android, haven’t tested on iOS
@ferdicus on iOS we’d implement it with: https://docs.mapbox.com/ios/api/maps/5.0.0/Enums/MGLAnnotationVerticalAlignment.html
see: https://github.com/nitaliano/react-native-mapbox-gl/pull/897/commits/07a03277872c3501431873b4f704944de980bdde
on android we’d done it with something like this:
https://github.com/nitaliano/react-native-mapbox-gl/pull/897/commits/b3dffe974aa9105416bff7360c8613a94516dcc1
This was the full PR: https://github.com/nitaliano/react-native-mapbox-gl/pull/897