Skip to content

Commit

Permalink
docs: add migration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiKilian committed Dec 16, 2024
1 parent 1703d6d commit cf20cbe
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 3 deletions.
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

0 comments on commit cf20cbe

Please sign in to comment.