-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea to re-use the shifter implementation of Point
from the mapbox-java
is clever, but it's going to work only for the LocationComponent
. Every call to MapboxMap
's camera APIs is still going to result in an incorrect camera position.
I'd rather call CoordinateShifterManager#getCoordinateShifter
and use it in the CameraPosition#Builder
that will handle both of the cases. Also, keep in mind that if the builder is used to shift coordinates, the CameraPosition#DEFAULT
should be initialized using the builder as well.
Additionally, do we have to "unshift" the coordinates when we call CameraPosition#target
getter?
@LukasPaczos If make shift in Btw, we can't unshift location in china plugin. |
...orm/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java
Outdated
Show resolved
Hide resolved
...orm/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java
Outdated
Show resolved
Hide resolved
c121886
to
156de99
Compare
Thanks for the updates @Chaoba. I revisited the setup and here are a couple of thoughts:
Let me know what's your take @Chaoba. Any other thoughts @mapbox/maps-android? |
@LukasPaczos Thanks for your thoughts. If we add a After due consideration I think we shift location in |
We should call it right before geometry is passed to the core (for example in the |
We are removing platform code from gl-native in #15970. If you want to see this PR merged, it will require re-implementation in https://github.com/mapbox/mapbox-gl-native-android. |
Resolves #14846
Shift is not used on camera, so it will show wrong location when using location shift.
In this PR, we implement shift in
CameraPosition.Builder().build()
method for the origin location. Also add test demo in test app.