Mapbox - changing pitch on touch screens - mapbox-gl-js

In MapBoxGL JS the pitch of a map can be changed by holding down the CTRL key, holding down the mouse and then moving it. Is there an equivalent way to accomplish this on a touch screen with no keyboard (e.g. smartphones). The context of this question - I want to use mapInstance.getPitch to record the last pitch selected by the user.

Yes, using two fingers on one's smartphone.

Related

Zoom & pan with trackpad on web without clicking

I'm trying to add the panning & zoom functionality on web & desktop for both trackpad & touch (without a modifier, click or key).
The main issue i'm facing is that the widgets I am using i.e. GestureDetector/onScale, InteractiveViewer(based on onScale)... are always working on desktop as I expect but fail to work on web: On web, zoom is fine but the only way to pan is by a tap + a 2 fingers swipe.
I am not sure if this is a limitation of browsers/js, flutter implementation or If I am missing something.
Do you have any approach to implement this?
Relevant links:
https://github.com/flutter/engine/pull/36342
https://kenneth.io/post/detecting-multi-touch-trackpad-gestures-in-javascript
I have both behaviors implemented via onPointerSignal but it only works because I make a difference between panning & zooming by pressing a specific key on top of a simple scroll event.
onPointerPanZoomStart from Listener is trackpad-specific but only works on windows.
Web/js seems to be using the ctrlKey attached to a mouse event to filter pan zoom & zoom trackpad event.
At the moment i'm exploring MultiTapGestureRecognizer and if supported by web and not touch specific, will allow me to get different pointer ids and calculate proper deltas.

Turn off Animation on Mapbox

I have a map that has a search box. A user types an address, and presses enter. The map then zooms out, pans to wherever the target is, then zooms in again. I understand from documentation that this is default behavior and that it's commonly referred to as "Fly To".
The question is... How do you disable this? I don't need fancy animation, I just want it to quickly draw a new map at the Lat/Long chosen and set the zoom level I specify.
Can this be done?
I assume you're using Mapbox-GL-Geocoder.
Just use setFlyTo:
geocoder.setFlyTo(false);

Setting the focus depth of the AVCaptureDevice ios

I want to set the focus of the camera to be a fixed value (in my case 6"). Objects that are 6in from the camera will be in focus and anything else will be out of focus.
But I don't see any way to hook into the focus value of the iphone camera. You can turn the autofocus on and off or even focus to a point in your image, but that will not work in my case.
Any thoughts?
Can you force the focus of the camera to be a given distance?
No. You can't currently set the focus distance manually in iOS. There are no public APIs to do so.

zoom out in MKMapView

When you double tap on MKMapView : zoom in.
But how to zoom out??
There's always using two fingers to zoom in and out. On the emulator you need to hold down an option key to get 'two fingers' appear on the emulated screen (I think it's the Alt key but I use a PC keyboard on my mac so may differ on a real mac keyboard)
As for doing it procedurally you need to set the region on the mapkit.
via the setRegion method of your MKMapKit object.
Make sure you're within bounds though as it will cause a crash if not. (i.e. long -180

iphone simulator using multi-touch problem

i know in iphone simulator to input using multi-touch, hold down the OPT key while using the mouse. will see two virtual fingertips.and move the mouse to pinch in and out.
my problem is in simulator,these two fingertips will only be overlap at the center all the time, if i jus want move one finger and another finger fix at a point,rather move two fingertips together how to achieve this in iphone simulator?in other word i want this two virtual finger can be overlap anywhere on the screen but not just center
If you press Shift-Option they will also move together with a static distance.