Skip to content

Commit

Permalink
feat : add getGeoPointMarkers in osm_interface (liodali#237)
Browse files Browse the repository at this point in the history
* add new method `getGeoPointMarkers` in osm_interface
* implement `getGeoPointMarkers` in osm_channel
  • Loading branch information
liodali committed Mar 27, 2022
1 parent 120d5e9 commit 8ccf8ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flutter_osm_plugin
![pub](https://img.shields.io/badge/pub-v0.32.1-orange)
![pub](https://img.shields.io/badge/pub-v0.33.0-orange)


## Platform Support
Expand Down Expand Up @@ -41,7 +41,7 @@
Add the following to your `pubspec.yaml` file:

dependencies:
flutter_osm_plugin: ^0.32.2
flutter_osm_plugin: ^0.33.0


### Migration to `0.16.0` (Android Only)
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.32.1"
version: "0.32.2"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down
10 changes: 8 additions & 2 deletions flutter_osm_interface/lib/src/channel/osm_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,12 @@ class MethodChannelOSM extends MobileOSMPlatform {
result.map((e) => Map<String, dynamic>.from(e)).toList();
return mapRoadInfo.map((e) => RoadInfo.fromMap(e)).toList();
}

@override
Future<List<GeoPoint>> getGeoPointMarkers(int idOSM) async {
final list = await _channels[idOSM]!.invokeListMethod("get#geopoints");
return (list as List<Map>).map((e) => GeoPoint.fromMap(e)).toList();
}
}

extension config on MethodChannelOSM {
Expand All @@ -721,10 +727,10 @@ extension config on MethodChannelOSM {
await _channels[idOSM]?.invokeMethod('config#Zoom', args);
}

Future<void> initIosMap(int idOSM,GlobalKey key) async {
Future<void> initIosMap(int idOSM, GlobalKey key) async {
await _channels[idOSM]?.invokeMethod("init#ios#map");
final icon = (await _capturePng(key)).convertToString();
await _channels[idOSM]?.invokeMethod("setDefaultIOSIcon",icon);
await _channels[idOSM]?.invokeMethod("setDefaultIOSIcon", icon);
}
}

Expand Down
4 changes: 4 additions & 0 deletions flutter_osm_interface/lib/src/osm_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,8 @@ abstract class MobileOSMPlatform extends OSMPlatform {
Future<BoundingBox> getBounds(
int idOSM,
);

Future<List<GeoPoint>> getGeoPointMarkers(
int idOSM,
);
}

0 comments on commit 8ccf8ab

Please sign in to comment.