Skip to content

Commit 919e8ed

Browse files
luisluis
luis
authored and
luis
committed
feat: Take snapshots of the map
Also fixes memory leak issue of apple_maps_flutter
1 parent ad9b211 commit 919e8ed

File tree

5 files changed

+72
-2
lines changed

5 files changed

+72
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.2
2+
3+
* Updates apple_maps_flutter to apply memory leak fix
4+
* makes it possible to take snapshots of the map
5+
16
## 1.0.1
27

38
* Adds `newLatLngBounds` to PlatformMapController

example/android/.project

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>android</name>
4+
<comment>Project android created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16+
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>1602529678411</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
28+
</projectDescription>

example/android/app/.project

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>app</name>
4+
<comment>Project app created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16+
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>1602529678416</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
28+
</projectDescription>

lib/src/controller.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,13 @@ class PlatformMapController {
109109
}
110110
return _bounds;
111111
}
112+
113+
/// Returns the image bytes of the map
114+
Future<Uint8List?> takeSnapshot() async {
115+
if (Platform.isIOS) {
116+
return this.appleController!.takeSnapshot();
117+
} else if (Platform.isAndroid) {
118+
return this.googleController!.takeSnapshot();
119+
}
120+
}
112121
}

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: platform_maps_flutter
22
description: A Flutter package that combines google_maps and apple_maps to provide a crossplatform native map implementation.
3-
version: 1.0.1
3+
version: 1.0.2
44
homepage: https://github.com/LuisThein
55
repository: https://github.com/LuisThein/platform_maps_flutter
66
issue_tracker: https://github.com/LuisThein/platform_maps_flutter/issues
@@ -14,7 +14,7 @@ dependencies:
1414

1515
google_maps_flutter: ^2.0.1
1616
google_maps_flutter_platform_interface: ^2.0.3
17-
apple_maps_flutter: ^1.0.0
17+
apple_maps_flutter: ^1.0.1
1818

1919
dev_dependencies:
2020
flutter_test:

0 commit comments

Comments
 (0)