Skip to content

Commit

Permalink
feat: Take snapshots of the map
Browse files Browse the repository at this point in the history
Also fixes memory leak issue of apple_maps_flutter
  • Loading branch information
luis authored and luis committed Jul 1, 2021
1 parent ad9b211 commit 919e8ed
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.2

* Updates apple_maps_flutter to apply memory leak fix
* makes it possible to take snapshots of the map

## 1.0.1

* Adds `newLatLngBounds` to PlatformMapController
Expand Down
28 changes: 28 additions & 0 deletions example/android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1602529678411</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
28 changes: 28 additions & 0 deletions example/android/app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1602529678416</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
9 changes: 9 additions & 0 deletions lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,13 @@ class PlatformMapController {
}
return _bounds;
}

/// Returns the image bytes of the map
Future<Uint8List?> takeSnapshot() async {
if (Platform.isIOS) {
return this.appleController!.takeSnapshot();
} else if (Platform.isAndroid) {
return this.googleController!.takeSnapshot();
}
}
}
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: platform_maps_flutter
description: A Flutter package that combines google_maps and apple_maps to provide a crossplatform native map implementation.
version: 1.0.1
version: 1.0.2
homepage: https://github.com/LuisThein
repository: https://github.com/LuisThein/platform_maps_flutter
issue_tracker: https://github.com/LuisThein/platform_maps_flutter/issues
Expand All @@ -14,7 +14,7 @@ dependencies:

google_maps_flutter: ^2.0.1
google_maps_flutter_platform_interface: ^2.0.3
apple_maps_flutter: ^1.0.0
apple_maps_flutter: ^1.0.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 919e8ed

Please sign in to comment.