takeSnapshot method
Takes a snapshot of the current map and returns it as PNG bytes.
If width and height are given the snapshot is rendered at that size
(in logical pixels) by an offscreen renderer, keeping the current camera
position and style. When omitted the snapshot matches the current map
view size.
The offscreen renderer re-fetches the style, so runtime additions made through the controller (annotations, layers added with addLayer, images registered with addImage) are not part of the result - only what the style itself defines.
Throws a PlatformException if the style is not loaded yet or the snapshot fails.
Implementation
Future<Uint8List> takeSnapshot({int? width, int? height}) {
return _vietmapGLPlatform.takeSnapshot(width: width, height: height);
}