Skip to content

Commit

Permalink
build : 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
liodali committed Mar 24, 2023
1 parent ac08fae commit 4eaaf4c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## 1.3.0: add useMapListener
## 1.2.0: add customTile to useMapController
## 1.1.1: add code documentation
## 1.1.0: update osm_flutter & fix hooks
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## OSM_FLUTTER_HOOKS
![pub](https://img.shields.io/badge/pub-v1.2.0-blue)
![pub](https://img.shields.io/badge/pub-v1.3.0-blue)

## Features

Expand Down Expand Up @@ -32,6 +32,11 @@ class SimpleOSM extends HookWidget {
await controller.setZoom(zoomLevel: 15);
},
);
useMapListener(
controller: controller,
onSingleTap: (p) async {
await controller.addMarker(p);
});
return OSMFlutter(
controller: controller,
markerOption: MarkerOption(
Expand Down
21 changes: 18 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,18 @@ class SimpleOSM extends HookWidget {

@override
Widget build(BuildContext context) {
final controller = useMapController(
initMapWithUserPosition: true
);
final controller = useMapController(initMapWithUserPosition: true);
useMapIsReady(
controller: controller,
mapIsReady: () async {
await controller.setZoom(zoomLevel: 15);
},
);
useMapListener(
controller: controller,
onSingleTap: (p) async {
await controller.addMarker(p);
});
return OSMFlutter(
controller: controller,
initZoom: 10,
Expand All @@ -72,6 +75,18 @@ class SimpleOSM extends HookWidget {
),
),
),
userLocationMarker: UserLocationMaker(
personMarker: const MarkerIcon(
icon: Icon(
Icons.person,
size: 48,
color: Colors.red,
),
),
directionArrowMarker: const MarkerIcon(
icon: Icon(Icons.person),
),
),
trackMyPosition: true,
);
}
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies:
flutter:
sdk: flutter
flutter_hooks: ^0.18.5+1
flutter_osm_plugin: ^0.42.0
flutter_osm_plugin: ^0.53.0
osm_flutter_hooks:
path: ../

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: osm_flutter_hooks
description: this Package extension to add support manage hook state with osm_flutter
version: 1.2.0
version: 1.3.0
homepage: https://github.com/liodali/osm_flutter_hooks

environment:
Expand All @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
flutter_hooks: ^0.18.5+1
flutter_osm_plugin: ^0.42.0
flutter_osm_plugin: '>=0.53.1'


dev_dependencies:
Expand Down
3 changes: 0 additions & 3 deletions test/osm_flutter_hooks_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import 'package:flutter_test/flutter_test.dart';

import 'package:osm_flutter_hooks/osm_flutter_hooks.dart';

void main() {

Expand Down

0 comments on commit 4eaaf4c

Please sign in to comment.