How to open Google Maps in turn-by-turn navigation mode from a PWA (Android)

작성자

카테고리:

← 피드로
DEV Community · Lucas · 2026-06-20 개발(SW)
Cover image for How to open Google Maps in turn-by-turn navigation mode from a PWA (Android)

Lucas

The next attempt was the standard Maps URL:

window.open(`https://maps.google.com/maps?daddr=${lat},${lng}`, '_blank');

Enter fullscreen mode Exit fullscreen mode

This opens Maps, but in the browser — not the app. And it shows the route preview, not turn-by-turn navigation.

What worked: Android Intent URLs

Android supports a special URL scheme that tells Chrome to launch a native app directly:

window.location.href = `intent://navigation/now?ll=${lat},${lng}&title=Next+stop#Intent;scheme=google.navigation;package=com.google.android.apps.maps;end`;

Enter fullscreen mode Exit fullscreen mode

Breaking it down:

  • intent:// — tells Chrome this is an Android intent
  • navigation/now?ll=${lat},${lng} — opens Maps in navigation mode, starting immediately
  • #Intent;scheme=google.navigation — the URI scheme to use
  • package=com.google.android.apps.maps — the target app package
  • end — closes the intent syntax

This opens the Google Maps app directly and starts turn-by-turn navigation automatically — no extra taps needed. It also works with Android Auto.

The full function

export function openNavigation(destination: { lat: number; lng: number }): void {
  window.location.href = `intent://navigation/now?ll=${destination.lat},${destination.lng}&title=Next+stop#Intent;scheme=google.navigation;package=com.google.android.apps.maps;end`;
}

Enter fullscreen mode Exit fullscreen mode

Call it on any user gesture (tap, click) and it works without being blocked by the browser.

The app

The full PWA is open source if you want to see the context:

Built with React + TypeScript + Vite + Dexie.js + @vis.gl/react-google-maps.

If you’re building a PWA that needs to hand off to Google Maps navigation on Android, this intent URL is the cleanest solution I found. Hope it saves you the hour I spent figuring it out.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다