-
-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading from v8.2.1 -> 8.4.0 Broke Updating Camera Props #1621
Comments
@dorthwein Sorry you're having this issue! Setting up a new example with Redux integrated is kind of a lot of overhead just to verify. Are you able to run this example, and if so does the zoom change work? If it does, then I would suggest the problem is with your test repo. If it doesn't, would you be able to attach a video showing what it does? |
@naftalibeder here is an example of follow working & not working trying to set following the user. No redux. Test on real Android Device Be sure to initialize MapBox access token somewhere.
|
Some additional information, if we make the following change on the camera component from false, too true, things seem to work as intended. I'm sure there is a good reason why we don't do this though...any thoughts?
to
Breakdown seems to be in Also is there a reason we don't update this component to be a functional component instead? |
Setting this to
No reason not to do that, just the possible introduction of bugs, and developer effort. I would bet if you got a PR tested with that conversion, @ferdicus would be happy :) But as for the issue you’re having, I’m going to look into that this afternoon. I have a hunch. |
basically what @naftalibeder said:
PRs definitely welcome though :) Cheers 🍻 |
🙇🏿 |
100% understand. I'll try and slot some time around upgrading components/contributing where I can! ~ DFO ~ |
@naftalibeder - If you can point me in a direction, I can try and take a look at figuring out what could have changed btw. |
@dorthwein Sorry I didn't respond earlier, I think I may have resolved it in #1631 . Would you want to try pointing here
and see if that works? |
@naftalibeder I must be tripping because I could have swore I responded here.... Anyway - I tried your fixes, zoomTo is working if followUserLocation={true} however if it is false, it does not work. We have a specific use case relying on this thats basically a +/- zoom buttons. Also, setting followUserLocation={true} and setting followUserMode="course" does not cause the map to follow the user's location while driving :(. |
@dorthwein You're not crazy - you responded here. :) Let me check into it. |
Are you sure you don't have that backwards? I see This is because _followZoomLevel is never actually set - the function setFollowZoomLevel is never called. This seems to be a bug, but it's a part of the code base that I haven't touched, so I don't think my PR could have broken it. Check out the |
@naftalibeder - I'll try and take a look at it shortly - side note - do y'all use use followUserLocation or just update the camera? |
We just set |
@naftalibeder yeah I can confirm still not working although it takes some toggling and messing around with. Interestingly when using Lokito to mock locations on the examples, it doesn't update the user location, however Lokito does update the location in google maps, our project etc... Updating the key (which is effectively a remount) is a functional work around for us. @naftalibeder what are you using to mock location/moving? |
@dorthwein Let me double-check on Android - admittedly I do more testing on iOS. |
Same issue on IOS only when upgrading from 8.3.0 to 8.4.0 :'( |
Yes on Android no problem but on Ios when i use FlyTo to change my camera position, the zoomlevel passed zoomLevel Max. I tried to change flyTo at moveTo but it's same issue. |
@naftalibeder - I'm confirming on iOS if followerUserLocation: false, adjusting zoom level on iOS & Android does not work, even if we change the key. Some where some seriously breaking changes got introduced when adjusting camera props. |
@dorthwein Can you try the latest commit on this #1631? See this comment. |
Confirming this https://github.com/react-native-mapbox-gl/maps/pull/1631 fixes the zoom & follow issues on iOS & Android Great job @naftalibeder! |
Thank you for the fix. When could we expect a release with this? |
@narcismihaitech, today |
release |
I'm having this issue on 8.5.0. Updating zoomLevel props and nothing happens to the zoom after first component render. Is anyone else experiencing this? |
yes, still problems with switching followUserMode with state.... Forcing me to use the key prop
and when changing followZoomLevel, it causes buggy experiences |
@Cmoen11 Are you using the latest release version 8.5.0 ? |
@danidaryaweesh Yes, i'm using |
@Cmoen11 For me it is working on Android without having to use the key prop, although a bit buggy and not as smooth as iOS. |
@danidaryaweesh Could you share your react code for the map? |
@Cmoen11 We are using this library as a base for turn by turn navigation.
Updating zoom level in this way:
And default camera props is: Hope that this helps. |
Describe the bug
After upgrading from v8.2.1 -> v8.4.0 update camera props stoped working.
In iOS updating zoom and heading no longer work after initial load (follow modes do still work however).
In Android, no camera prop updates work after initial load.
To Reproduce
Create MapView map camera tied to a redux store for zoom & heading props. Outside of the component, have a button to adjust props. Zoom/Heading fail to update when external button is pressed updating camera props.
Could be resolved by https://github.com/react-native-mapbox-gl/maps/pull/1619 - but unclear.
Expected behavior
Map View Zoom & Heading update as expected on prop change to Camera component after initial load.
Actual behavior
Map View Zoom & Heading, and in Android, follow modes etc..., are reflected in Map View after updating the Map Camera.
Screenshots
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: