Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add migration docs #560

Merged
merged 1 commit into from
Dec 17, 2024
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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ diverged, it has become necessary to separate the projects into specific wrapper
- [Android](/docs/guides/setup/Android.md)
- [iOS](/docs/guides/setup/iOS.md)
- [Expo](/docs/guides/setup/Expo.md)
- Migrations
- [Migrating to v10](/docs/guides/migrations/v10.md)

### Components

Expand All @@ -41,9 +43,9 @@ diverged, it has become necessary to separate the projects into specific wrapper
- [PointAnnotation](/docs/components/PointAnnotation.md)
- [MarkerView](/docs/components/MarkerView.md)
- [Callout](/docs/components/Callout.md)
- [Camera](docs/components/Camera.md)
- [UserLocation](docs/components/UserLocation.md)
- [Images](docs/components/Images.md)
- [Camera](/docs/components/Camera.md)
- [UserLocation](/docs/components/UserLocation.md)
- [Images](/docs/components/Images.md)

### Sources

Expand Down
75 changes: 75 additions & 0 deletions docs/guides/migrations/v10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Migrating to v10

## Changes to `Camera` Component

### Default `animationMode` is now `CameraMode.None`

The default `animationMode` for a controlled `Camera` is now `CameraMode.None`. To reinstate previous behavior, change the following:

```diff
<Camera
centerCoordinates={[0, 0]}
+ animationDuration={2000}
+ animationMode="easeTo"
/>
```

### Removed `allowUpdates` and `triggerKey` Props

If you need this functionality, keep your props stable or use the imperative `setCamera`.

```diff
<Camera
centerCoordinates={[0, 0]}
- allowUpdates={false}
- triggerKey={someKey}
/>
```

## `MapView` props `styleURL` and `styleJSON` unified to `mapStyle`

The props `styleURL` and `styleJSON`, which control the style of the `MapView`, have been unified into a single `mapStyle` prop.

### `styleURL`

```diff
<MapView
- styleURL="https://some-style-url"
+ mapStyle="https://some-style-url"
/>
```

### `styleJSON`

A style object is now expected as an object, without `JSON.stringify`.

```diff
<MapView
- styleJSON={JSON.stringify(someStyleObject)}
+ mapStyle={someStyleObject}
/>
```

## Removed `Style` component

The `Style` component was redundant, as it's possible to pass a style object to the `MapView` directly.

```diff
- <MapView>
- <Style json={someStyleObject} />
- </MapView>
+ <MapView mapStyle={someStyleObject} />
```

## Replaced `OfflineProgressStatus` with `OfflinePackStatus`

The two types have been unified. Simply replace `OfflineProgressStatus` with `OfflinePackStatus`.

# Removed deprecated Methods, Props and Types

- `UserTrackingModes` was removed, use `UserTrackingMode` instead
- Removed `setCamera` from `MapView`, use imperative methods of `Camera` instead
- Removed `byId` methods from ShapeSource
- Removed `children` from SymbolSource
- Removed `assets` key from `Images`
- Removed deprecated event keys
Loading