-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Increased support for camera movement via keyboard #15736
Increased support for camera movement via keyboard #15736
Conversation
2 remaining hurdles here:
As you might notice in the 2nd GIF above, the bearing jumps after holding down Thoughts?
|
I think the most natural UX will come from using
nice feature but should only be possible for debug builds. We don't want end users enabling this.
I feel we shouldn't allow this functionality for end users, this could potentially break the interaction that a developer tries to achieve and break their application (they aren't managing style changes, they only have 1 style) |
Ok, my latest commit has switched zoom and pitch adjustments to For some reason,
I have the check for
I saw mention of and thought that's what you meant. I have the check for |
the arrow keys implementation was great for pitch, the request for zooming like this just came from other programs where the zoom action is associated with it.
This means the platform is already consuming the event and we can't use it Apologies for the confusion in above 2 sections, can we move forward with your initial setup of arrow keys? |
That was more specific for inclusion of the test app not for all end-users (even with debug build). |
I like your suggestion of In my latest commit, I've removed all Keyboard controls are now: Zoom: Pitch: Bearing: |
6d6c367
to
b75e5ae
Compare
@tobrun , I need to finish tests, but are you 👍 with the setup as described in the comment above? |
b75e5ae
to
867edcb
Compare
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. |
This pr resolves #10131 by bringing more keyboard to the Maps SDK for Android. It is a follow up to #14789.
Regarding @LukasPaczos' comment at #14789 (review): All the code is now in the
MapKeyListener
'sonKeyDown
/onKeyLongPress
methods.Regarding @tobrun's comment at #14789 (comment):
MapGestureDetector
no longer has any key listening code. All the code is contained inMapKeyListener
, which I think is appropriate.So far, this pr adds support for:
directional navigation (
NextFocusRight()
,NextFocusDown()
, etc.): https://developer.android.com/training/keyboard-input/navigation.htmladjusting the map camera via various keyboard key combinations:
The recommended way to try out this pr's work is to open the Maps SDK's test app on an emulator. Make sure the emulator supports keyboard input. Chances are good that the emulated device does. Open any test app example that loads a map.
directional navigation to adjust the
focus
Tab
key on your keyboard to see the app's focus cycle between theMapView
, theCompassView
(if it's visible), and the attributioni
. Pressing theEnter
key when the focus is on a particular view ID, is the equivalent of tapping on the view with your finger.adjusting map pitch via
shift
key and+
/-
buttonsshift
on your keyboard and then tap the up or down arrow. You can also hold either arrow. The up/down arrows should adjust the map camera's pitch. The up arrow will tilt the map plane "down", which matches the behavior in Mapbox Studio.adjusting map bearing via
shift
key and directional left/right arrowsshift
key and then tap the left or right arrows. You can also hold either arrow.shift
+left
will move the camera bearing so that the map camera appears to move in a clockwise direction around the focal point.shift
+left
will move the camera bearing so that the map camera appears to move in a counter-clockwise direction around the focal point.adjusting map zoom via
+
/-
buttons-
will move the camera farther away from the map by decreasing the zoom value.+
will move the map camera closer to the map by increasing the zoom value.The map movement in the GIFs below is all based on keyboard keys.
Debug toggling and switching to
Style.MAPBOX_STREETS
via keyboard