Giter Site home page Giter Site logo

Comments (13)

ferdicus avatar ferdicus commented on May 7, 2024

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.

mfazekas avatar mfazekas commented on May 7, 2024

@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.

ferdicus avatar ferdicus commented on May 7, 2024

I see, thanks for taking the time explaining it. 👍

from maps.

Blind12 avatar Blind12 commented on May 7, 2024

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.

anttijva avatar anttijva commented on May 7, 2024

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.

mfazekas avatar mfazekas commented on May 7, 2024

@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.

Blind12 avatar Blind12 commented on May 7, 2024

@mfazekas

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.

mfazekas avatar mfazekas commented on May 7, 2024

@Blind12 doesn't sound good, you should be able to set both followUserMode and followUserLocation same time without timer

from maps.

Blind12 avatar Blind12 commented on May 7, 2024

"@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 avatar anttijva commented on May 7, 2024

@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.

@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.

ShepelE avatar ShepelE commented on May 7, 2024

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.

sugaith avatar sugaith commented on May 7, 2024

Still happening

from maps.

dorthwein avatar dorthwein commented on May 7, 2024

still happening

from maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.