DocsTouch and keyboard

Touch and keyboard

Tap, pinch, rotate, one-finger pan, double tap and keyboard input on the map.

map.spec.tsTypeScript
test.use({ hasTouch: true });const here = { lng: 34.78, lat: 32.08 };await map.feature({ layer: 'alerts', id: 2 }).tap();// Playwright touchscreen.tap, fully verified like click()await map.pinchAt(here, { scale: 2 });// ≈ +1 zoom      } touch moves and multi-touch go through CDP:await map.twoFingerRotateAt(here, { degrees: 40 });// ≈ -22° bearing } Chromium only (Playwright has tap() only)await map.touchDragAt(here, { lng: 34.79, lat: 32.07 });// one-finger pan (MapLibre adds inertia, as for a real swipe)await map.doubleTapAt(here);// zoom in by one around the fingerawait map.keyboard.press('Shift+ArrowRight');// map focused, real key: MapLibre rotates 15°