# Get directions opens system maps app via deeplink

- **Pattern:** `ab-001051` (`directory-map-location.directions.directions-deeplink`)
- **Severity:** low
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-001051
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-001051)

## Why it matters

A "Get Directions" button that opens an in-app directions view rather than the system maps app forces users to navigate with a less capable tool while their preferred navigation app sits unused. Schema.org Place expects machine-readable location data that enables native integrations; failing to deeplink to system maps is a missed integration with the platform's established navigation intent. For mobile users in particular, the system maps app (Apple Maps, Google Maps) has saved routes, voice guidance, and real-time traffic that an in-app view cannot replicate. Not providing a deeplink is a UX failure that increases friction at the moment of highest intent: the user is ready to physically go somewhere.

## Severity rationale

Low because in-app directions still function, but missing the system maps deeplink degrades navigation UX and ignores the established platform intent for directions on mobile devices.

## Remediation

Construct deeplinks that open the device's default maps application using coordinate parameters — not address strings, which require the maps app to re-geocode.

```tsx
function getDirectionsUrl(lat: number, lng: number, name: string): string {
  const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
  if (isIOS) {
    return `maps://maps.apple.com/?daddr=${lat},${lng}&q=${encodeURIComponent(name)}`;
  }
  return `https://maps.google.com/?daddr=${lat},${lng}`;
}

function ListingDetail({ listing }: { listing: Listing }) {
  return (
    <a
      href={getDirectionsUrl(listing.latitude, listing.longitude, listing.name)}
      target="_blank"
      rel="noopener noreferrer"
    >
      Get Directions
    </a>
  );
}
```

Verify the link appears on all listing detail pages, not just the map popup. See `directory-map-location.directions.deeplink-coordinates` — the deeplink must use stored coordinates, not the address string.

## Detection

- **ID:** `directions-deeplink`
- **Severity:** `low`
- **What to look for:** Click the "Get Directions" or "Open in Maps" button on a listing detail page. Verify that it opens the system maps app (Apple Maps on iOS, Google Maps on Android) rather than an in-app directions view. Check the link href or button click handler for deeplink format.
- **Pass criteria:** Clicking "Get Directions" opens the user's default maps application with the listing location. List all listing detail pages and confirm at least 100% include a directions trigger. Works on both iOS and Android.
- **Fail criteria:** No "Get Directions" button exists. Clicking it does nothing, or opens an in-app view with limited functionality. A directions link that only works on one platform does not count as pass.
- **Skip (N/A) when:** Directions feature does not exist, or the platform links to external maps only (which is acceptable).
- **Detail on fail:** `"Get Directions button opens an in-app directions view instead of system maps app"` or `"No directions button found on listing detail page"`
- **Remediation:** Use deeplinks to system maps apps:

  ```tsx
  function ListingDetail({ listing }) {
    const getDirectionsUrl = () => {
      const { lat, lng, name } = listing;
      const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);

      if (isIOS) {
        return `maps://maps.apple.com/?daddr=${lat},${lng}&q=${encodeURIComponent(name)}`;
      } else {
        return `https://maps.google.com/?daddr=${lat},${lng}`;
      }
    };

    return (
      <a href={getDirectionsUrl()} target="_blank">
        Get Directions
      </a>
    );
  }
  ```

## External references

- schema-org Place

Taxons: user-experience

HTML version: https://auditbuffet.com/patterns/ab-001051
