|
1 |
| -### main |
2 |
| - |
3 |
| -* Update Maps SDK to 11.4.0. |
4 |
| - |
5 |
| -### 2.0.0-rc.1 |
6 |
| - |
7 |
| -* Update Maps SDK to 11.4.0-rc.2. |
8 |
| - |
9 |
| -### 2.0.0-beta.1 |
10 |
| - |
11 |
| -* Introduce experimental `RasterArraySource`, note that `rasterLayers` is a get-only property and cannot be set. |
12 |
| -* Introduce `TileCacheBudget`, a property to set per-source cache budgets in either megabytes or tiles. |
13 |
| -* Expose `iconColorSaturation`, `rasterArrayBand`, `rasterElevation`, `rasterEmissiveStrength`, `hillshadeEmissiveStrength`, and `fillExtrusionEmissiveStrength` on their respective layers. |
14 |
| -* Mark `MapboxMapsOptions.get/setWorldview()` and `MapboxMapsOptions.get/setLanguage()` as experimental. |
15 |
| -* Bump Pigeon to 17.1.2 |
16 |
| -* [iOS] Fix crash in `onStyleImageMissingListener`. |
17 |
| -* Deprecate `cameraForCoordinates`, please use `cameraForCoordinatesPadding` instead. |
18 |
| -* Add a way to disable default puck's image(s) when using `DefaultLocationPuck2D`. By passing an empty byte array, for example, the following code shows a puck 2D with custom top image, default bearing image and no shadow image. |
19 |
| -``` |
20 |
| -mapboxMap?.location.updateSettings(LocationComponentSettings( |
21 |
| - enabled: true, |
22 |
| - puckBearingEnabled: true, |
23 |
| - locationPuck: |
24 |
| - LocationPuck(locationPuck2D: DefaultLocationPuck2D(topImage: list, shadowImage: Uint8List.fromList([])))) |
25 |
| -); |
26 |
| -``` |
27 |
| -##### Snapshots |
28 |
| - |
29 |
| -###### Standalone snapshotter |
30 |
| - |
31 |
| -Show multiple maps at the same time with no performance penalty. With the all new `Snapshotter` you can get image snapshots of the map, styled the same way as `MapWidget`. |
32 |
| - |
33 |
| -The `Snapshotter` class is highly configurable. You can set the final result at the time of construction using the `MapSnapshotOptions`. Once you've configured your snapshot, you can start the snapshotting process. |
34 |
| - |
35 |
| -One of the key features of the `Snapshotter` class is the `style` object. This object can be manipulated to set different styles for your snapshot, as well as to apply runtime styling to the style, giving you the flexibility to create a snapshot that fits your needs. |
36 |
| - |
37 |
| -```dart |
38 |
| -final snapshotter = await Snapshotter.create( |
39 |
| - options: MapSnapshotOptions( |
40 |
| - size: Size(width: 400, height: 400), |
41 |
| - pixelRatio: MediaQuery.of(context).devicePixelRatio), |
42 |
| - onStyleLoadedListener: (_) { |
43 |
| - // apply runtime styling |
44 |
| - final layer = CircleLayer(id: "circle-layer", sourceId: "poi-source"); |
45 |
| - snapshotter?.style.addLayer(layer); |
46 |
| - }, |
47 |
| -); |
48 |
| -snapshotter.style.setStyleURI(MapboxStyles.STANDARD); |
49 |
| -snapshotter.setCamera(CameraOptions(center: Point(...))); |
50 |
| -
|
51 |
| -... |
52 |
| -
|
53 |
| -final snapshotImage = await snapshotter.start() |
54 |
| -``` |
55 |
| -##### Map widget snapshotting |
56 |
| - |
57 |
| -Create snapshots of the map displayed in the `MapWidget` with `MapboxMap.snapshot()`. This new feature allows you to capture a static image of the current map view. |
58 |
| - |
59 |
| -The `snapshot()` method captures the current state of the Mapbox map, including all visible layers, markers, and user interactions. |
60 |
| - |
61 |
| -To use the snapshot() method, simply call it on your Mapbox map instance. The method will return a Future that resolves to the image of the current map view. |
62 |
| - |
63 |
| -```dart |
64 |
| -final snapshotImage = await mapboxMap.snapshot(); |
65 |
| -``` |
66 |
| - |
67 |
| -Please note that the `snapshot()` method works best if the Mapbox Map is fully loaded before capturing an image. If the map is not fully loaded, the method might return a blank image. |
| 1 | +### 2.0.0 |
68 | 2 |
|
69 | 3 | #### ⚠️ Breaking changes
|
70 | 4 |
|
@@ -164,11 +98,69 @@ PolylineAnnotationOptions(
|
164 | 98 | ])
|
165 | 99 | )
|
166 | 100 | ```
|
| 101 | +##### Snapshots |
| 102 | + |
| 103 | +###### Standalone snapshotter |
| 104 | + |
| 105 | +Show multiple maps at the same time with no performance penalty. With the all new `Snapshotter` you can get image snapshots of the map, styled the same way as `MapWidget`. |
| 106 | + |
| 107 | +The `Snapshotter` class is highly configurable. You can set the final result at the time of construction using the `MapSnapshotOptions`. Once you've configured your snapshot, you can start the snapshotting process. |
| 108 | + |
| 109 | +One of the key features of the `Snapshotter` class is the `style` object. This object can be manipulated to set different styles for your snapshot, as well as to apply runtime styling to the style, giving you the flexibility to create a snapshot that fits your needs. |
| 110 | + |
| 111 | +```dart |
| 112 | +final snapshotter = await Snapshotter.create( |
| 113 | + options: MapSnapshotOptions( |
| 114 | + size: Size(width: 400, height: 400), |
| 115 | + pixelRatio: MediaQuery.of(context).devicePixelRatio), |
| 116 | + onStyleLoadedListener: (_) { |
| 117 | + // apply runtime styling |
| 118 | + final layer = CircleLayer(id: "circle-layer", sourceId: "poi-source"); |
| 119 | + snapshotter?.style.addLayer(layer); |
| 120 | + }, |
| 121 | +); |
| 122 | +snapshotter.style.setStyleURI(MapboxStyles.STANDARD); |
| 123 | +snapshotter.setCamera(CameraOptions(center: Point(...))); |
| 124 | +
|
| 125 | +... |
| 126 | +
|
| 127 | +final snapshotImage = await snapshotter.start() |
| 128 | +``` |
| 129 | +##### Map widget snapshotting |
| 130 | + |
| 131 | +Create snapshots of the map displayed in the `MapWidget` with `MapboxMap.snapshot()`. This new feature allows you to capture a static image of the current map view. |
| 132 | + |
| 133 | +The `snapshot()` method captures the current state of the Mapbox map, including all visible layers, markers, and user interactions. |
| 134 | + |
| 135 | +To use the snapshot() method, simply call it on your Mapbox map instance. The method will return a Future that resolves to the image of the current map view. |
| 136 | + |
| 137 | +```dart |
| 138 | +final snapshotImage = await mapboxMap.snapshot(); |
| 139 | +``` |
| 140 | + |
| 141 | +Please note that the `snapshot()` method works best if the Mapbox Map is fully loaded before capturing an image. If the map is not fully loaded, the method might return a blank image. |
167 | 142 |
|
168 | 143 | * Fix camera center not applied from map init options.
|
169 | 144 | * [iOS] Free up resources upon map widget disposal. This should help to reduce the amount of used memory when previously shown map widget is removed from the widget tree.
|
170 | 145 | * Fix multi-word enum cases decoding/encoding when being sent to/from the platform side.
|
171 | 146 | * [Android] Add Gradle 8 compatibility.
|
| 147 | +* Introduce experimental `RasterArraySource`, note that `rasterLayers` is a get-only property and cannot be set. |
| 148 | +* Introduce `TileCacheBudget`, a property to set per-source cache budgets in either megabytes or tiles. |
| 149 | +* Expose `iconColorSaturation`, `rasterArrayBand`, `rasterElevation`, `rasterEmissiveStrength`, `hillshadeEmissiveStrength`, and `fillExtrusionEmissiveStrength` on their respective layers. |
| 150 | +* Mark `MapboxMapsOptions.get/setWorldview()` and `MapboxMapsOptions.get/setLanguage()` as experimental. |
| 151 | +* Bump Pigeon to 17.1.2 |
| 152 | +* [iOS] Fix crash in `onStyleImageMissingListener`. |
| 153 | +* Deprecate `cameraForCoordinates`, please use `cameraForCoordinatesPadding` instead. |
| 154 | +* Add a way to disable default puck's image(s) when using `DefaultLocationPuck2D`. By passing an empty byte array, for example, the following code shows a puck 2D with custom top image, default bearing image and no shadow image. |
| 155 | +```dart |
| 156 | +mapboxMap?.location.updateSettings(LocationComponentSettings( |
| 157 | + enabled: true, |
| 158 | + puckBearingEnabled: true, |
| 159 | + locationPuck: |
| 160 | + LocationPuck(locationPuck2D: DefaultLocationPuck2D(topImage: list, shadowImage: Uint8List.fromList([])))) |
| 161 | +); |
| 162 | +``` |
| 163 | +* Update Maps SDK to 11.4.0. |
172 | 164 |
|
173 | 165 | ### 1.1.0
|
174 | 166 |
|
|
0 commit comments