You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Add snapshot for Android
* feat: Add snapshot for iOS
* chore: add script for snapshot
* Replace offscreen snapshotting with the static one
* Make snapshotter return image instead of byte list
* Add changelog entry
* Fix Android build error
* Remove debug code from the snapshotter example
* Add integrations tests for snapshotter
* Change snapshot return type to int list
* Remove debug print
* Apply suggestions from code review
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
* MapWidget snapshotting (#513)
* Add method to capture snapshot from mapbox map
* Change snapshot type to int list
* Add integration test
* Update example/lib/snapshotter.dart
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
* Remove commented out code
---------
Co-authored-by: lantah <lsxt10@qq.com>
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
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`.
24
+
25
+
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.
26
+
27
+
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.
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.
50
+
51
+
The `snapshot()` method captures the current state of the Mapbox map, including all visible layers, markers, and user interactions.
52
+
53
+
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.
54
+
55
+
```dart
56
+
final snapshotImage = await mapboxMap.snapshot();
57
+
```
58
+
59
+
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.
0 commit comments