Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 0 additions & 96 deletions docs/navigation/api.md

This file was deleted.

29 changes: 29 additions & 0 deletions docs/navigation/api/Components/NavigationView.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
sidebar_label: NavigationView
sidebar_position: 1
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# NavigationView()

```ts
function NavigationView(props: NavigationViewProps): Element;
```

Full-screen turn-by-turn navigation UI: `NavigationViewController` from `MapboxNavigationUIKit` on iOS, and an
equivalent built from the Navigation SDK UI components on Android.

It uses the app's single navigation session: mounting it, or giving it a new route, starts guidance along that route,
replacing any active guidance, and unmounting it or the user ending the trip stops guidance. Show one at a time.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `props` | [`NavigationViewProps`](NavigationViewProps.md) | See [NavigationViewProps](NavigationViewProps.md). |

## Returns

`Element`
22 changes: 22 additions & 0 deletions docs/navigation/api/Components/NavigationViewError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
sidebar_label: NavigationViewError
sidebar_position: 4
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# NavigationViewError

```ts
type NavigationViewError = object;
```

Passed to `onError` of [NavigationView](NavigationView.md) and [RNNavigationView](RNNavigationView.md).

## Properties

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="code"></a> `code` | `string` | E.g. `route_request_failed`, `route_released`, `start_failed`. |
| <a id="message"></a> `message` | `string` | Human-readable, from the SDK where it has one. |
30 changes: 30 additions & 0 deletions docs/navigation/api/Components/NavigationViewProps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
sidebar_label: NavigationViewProps
sidebar_position: 6
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# NavigationViewProps

```ts
type NavigationViewProps = object;
```

Props of [NavigationView](NavigationView.md). Pass either `route` or `waypoints`.

## Properties

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="mute"></a> `mute?` | `boolean` | Mutes voice instructions. The view's own mute button also toggles them. |
| <a id="onarrive"></a> `onArrive?` | (`event`: [`ArriveEvent`](../Events/ArriveEvent.md)) => `void` | Same event as [Navigation.addArriveListener](../Core/Navigation.md#addarrivelistener). |
| <a id="oncancel"></a> `onCancel?` | () => `void` | The user ended the trip; guidance has stopped. Unmount the view. |
| <a id="onerror"></a> `onError?` | (`error`: [`NavigationViewError`](NavigationViewError.md)) => `void` | The route request or the start of guidance failed. |
| <a id="onrouteprogress"></a> `onRouteProgress?` | (`event`: [`RouteProgressEvent`](../Events/RouteProgressEvent.md)) => `void` | Same event as [Navigation.addRouteProgressListener](../Core/Navigation.md#addrouteprogresslistener). |
| <a id="route"></a> `route?` | [`Route`](../Routes/Route.md) | Route from `requestRoutes`. Keep it unreleased while it's passed to the view. |
| <a id="simulate"></a> `simulate?` | `boolean` | Drive the route with simulated locations. Read when guidance starts. |
| <a id="style"></a> `style?` | `StyleProp`\<`ViewStyle`\> | - |
| <a id="testid"></a> `testID?` | `string` | - |
| <a id="waypoints"></a> `waypoints?` | [`Waypoint`](../Routes/Waypoint.md)[] | Used when `route` isn't set: the view requests a route through them, origin first, and releases it on unmount. |
27 changes: 27 additions & 0 deletions docs/navigation/api/Components/NavigationViewport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
sidebar_label: NavigationViewport
sidebar_position: 2
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# NavigationViewport()

```ts
function NavigationViewport(props: NavigationViewportProps): Element;
```

Configures the navigation camera of the `@rnmapbox/maps` `MapView` it's a child of:
`<MapView mapViewImpl={NAVIGATION_MAP_VIEW_IMPL}><NavigationViewport padding={{ bottom: 120 }} /></MapView>`.
Without it the SDK defaults apply: the safe area plus a small margin on iOS, no padding on Android.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `props` | [`NavigationViewportProps`](NavigationViewportProps.md) | See [NavigationViewportProps](NavigationViewportProps.md). |

## Returns

`Element`
21 changes: 21 additions & 0 deletions docs/navigation/api/Components/NavigationViewportProps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
sidebar_label: NavigationViewportProps
sidebar_position: 5
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# NavigationViewportProps

```ts
type NavigationViewportProps = object;
```

Props of [NavigationViewport](NavigationViewport.md).

## Properties

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="padding"></a> `padding?` | [`ViewportPadding`](ViewportPadding.md) | Area the navigation camera keeps the puck and the route in, e.g. to keep them clear of UI drawn over the map. Applies to `following`, `overview` and the route preview. |
30 changes: 30 additions & 0 deletions docs/navigation/api/Components/RNNavigationView.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
sidebar_label: RNNavigationView
sidebar_position: 3
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# RNNavigationView()

```ts
function RNNavigationView(props: RNNavigationViewProps): Element;
```

`<NavigationView>` built in React Native from the headless API, on an `@rnmapbox/maps` navigation map: a maneuver
banner with lanes, speed limit, road name, trip progress, mute, overview/recenter and end buttons, and an arrival
message.

It uses the app's single navigation session like `<NavigationView>`. Use it as is, or copy it as a starting point
for your own UI.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `props` | [`RNNavigationViewProps`](RNNavigationViewProps.md) | See [RNNavigationViewProps](RNNavigationViewProps.md). |

## Returns

`Element`
33 changes: 33 additions & 0 deletions docs/navigation/api/Components/RNNavigationViewProps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
sidebar_label: RNNavigationViewProps
sidebar_position: 7
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# RNNavigationViewProps

```ts
type RNNavigationViewProps = NavigationViewProps & object;
```

Props of [RNNavigationView](RNNavigationView.md): [NavigationViewProps](NavigationViewProps.md), plus the props below.

## Type Declaration

### children?

```ts
children?: ReactNode;
```

Rendered inside the `MapView`, e.g. extra sources and layers.

### styleURL?

```ts
styleURL?: string;
```

Defaults to Mapbox Standard.
24 changes: 24 additions & 0 deletions docs/navigation/api/Components/ViewportPadding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
sidebar_label: ViewportPadding
sidebar_position: 8
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# ViewportPadding

```ts
type ViewportPadding = object;
```

Points from the map's edges, ignoring the safe area.

## Properties

| Property | Type |
| ------ | ------ |
| <a id="bottom"></a> `bottom?` | `number` |
| <a id="left"></a> `left?` | `number` |
| <a id="right"></a> `right?` | `number` |
| <a id="top"></a> `top?` | `number` |
4 changes: 4 additions & 0 deletions docs/navigation/api/Components/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Components",
"position": 2
}
16 changes: 16 additions & 0 deletions docs/navigation/api/Core/CameraState.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
sidebar_label: CameraState
sidebar_position: 3
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# CameraState

```ts
type CameraState = "following" | "overview" | "idle";
```

Camera of navigation maps. `following` follows the puck, tilted and rotated with the route; `overview` fits the rest
of the route; `idle` leaves the map to the user's gestures and `@rnmapbox/maps` `Camera`.
16 changes: 16 additions & 0 deletions docs/navigation/api/Core/NAVIGATION_MAP_VIEW_IMPL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
sidebar_label: NAVIGATION_MAP_VIEW_IMPL
sidebar_position: 2
custom_edit_url: null
---

{/* Generated from rnmapbox/navigation/src by `yarn docs`. Don't edit. */}

# NAVIGATION_MAP_VIEW_IMPL

```ts
const NAVIGATION_MAP_VIEW_IMPL: "rnmbxnav" = 'rnmbxnav';
```

Pass as `mapViewImpl` to an `@rnmapbox/maps` `MapView` to render the route line, the puck and the
navigation camera on it: `<MapView mapViewImpl={NAVIGATION_MAP_VIEW_IMPL}>`.
Loading
Loading