Comments (13)
hey @mfazekas, thanks for taking care of this.
Can you elaborate a bit please on how the value can be null
at that line when followUserMode
was defined?
Just curious.
from maps.
@ferdicus updatedFollowUserMode
also get's called from setFollowUserLocation
.
We happen to have this.refs.camera.setNativeProps({followUserLocation: true})
before the mode so we set followUserLocation first and it's possibl that followUserMode was not yet set on the native side and it defaults to null.
from maps.
I see, thanks for taking the time explaining it. 👍
from maps.
Hi,
I tried many times in many ways to use <MapboxGL.Camera followUserLocation/> with and without the prop followUserMode="normal".
Every time, I got the error above with a null object ref. Is the doc not up to date or the examples I found in the doc using this prop?
Thank you for your time.
from maps.
To me it seems at the followUserMode is working a little weird. The icon doesn't change between modes, and the old userTrackingMode "followWithHeading" doesn't seem to exist anymore.
I tried out multiple different configurations but can't seem to get it working.
from maps.
@anttijva followUserMode now can be ['normal', 'compass', 'course'], compass
is equivalent to old followWithHeading
.
The icons could be changed via UserLocation#renderMode, but for now only ['normal','custom']
is supported.
from maps.
Do you know if it's an expected behavior what you explained above ? About the followUserMode set to null by default and used by followUserLocation. The workaround I found for now is to set a timer and set the followUserLocation : true when the component is mounted or after x seconds.
Thank you.
from maps.
@Blind12 doesn't sound good, you should be able to set both followUserMode
and followUserLocation
same time without timer
from maps.
"@react-native-mapbox-gl/maps": "^7.0.0-rc3",
"react-native": "0.59.9",
"react": "16.8.3",
This simple code :
<MapboxGL.MapView
ref={(ref) => (this._map = ref)}
style={{flex: 1}}
animated={true}
rotateEnabled={false}
pitchEnabled={false}
>
<MapboxGL.UserLocation
renderMode="normal"
/>
<MapboxGL.Camera
followUserLocation={true}
followUserMode="normal"
/>
throw the error posted by the author.
from maps.
@anttijva followUserMode now can be ['normal', 'compass', 'course'],
compass
is equivalent to oldfollowWithHeading
.
The icons could be changed via UserLocation#renderMode, but for now only['normal','custom']
is supported.
@mfazekas Okay that explains the icons, but the functionality is still a mystery. Before, if I activated followWithHeading/followWithCourse, the map would change position according to how I was turning the phone (using gyro/compass?) but now I can't seem to get that working. Any ideas?
from maps.
Hi!
@ferdicus, It looks like the bug I had.
I found some workaround here: https://github.com/react-native-mapbox-gl/maps/issues/344
Please check if it helps in your case
from maps.
Still happening
from maps.
still happening
from maps.
Related Issues (20)
- [Bug]: iOS: Can only change pitch or heading via setCamera when centerCoordinate is specified
- [Bug]: Task :app:checkDebugDuplicateClasses FAILED HOT 4
- [Bug]: Crash when changing Annotations source state in iOS
- [Bug]: Map is not usable in a (horizontal) ScrollView on Android HOT 4
- Crash on latest version on iOS (getZoom) HOT 1
- [Bug]: Image marker as SymbolLayer in ShapeSource does not appear on long press event
- [Bug]: iOS PointAnnotation need to "longpress" before you can start dragging it on the map, on Android you can drag immediately after Press/Tap HOT 1
- [Bug]: queryRenderedFeaturesAtPoint is inconsistent when using onLongPress on MapView
- [Bug]: TypeScript style props exports not working properly HOT 3
- Support for iOS 12.4 with Mapbox Maps SDK v11 HOT 2
- [Bug]: Custom Styles on iOS HOT 1
- [Bug]: LocationPuck topImage inconsistent with iOS HOT 1
- [Bug]: marker views not propagating press events from their children HOT 1
- [Bug]: App is crashing with large data of features. Mainly with points HOT 1
- [Bug]: App is crashing with large data of features. Mainly with points
- Crash on android when loading ImageSource from image uri HOT 1
- [Bug]: iOS topImage inconsistent rendering
- Updating mapbox-maps-ios to 10.17.0 - May 1st iOS Privacy Manifest issue HOT 20
- [Bug]: Setting 'defaultSettings' on '<Mapbox.Camera />' showing the wrong location on very first render of the app HOT 1
- [Bug]: Sibling MarkerViews not observing zIndex style property
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maps.