Skip to content

Commit

Permalink
docs : create docs for 0.29.0
Browse files Browse the repository at this point in the history
* update readme,changelog
* add some docs for requestPermission
  • Loading branch information
liodali committed Jan 22, 2022
1 parent 2fdaeda commit 337c9e5
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.29.0:
* create `changeIconMarker` to change icon of existing marker
* remove location package and replaced with permission_handler
* implement location permission for iOS manually
* replace shw diolog ( use google service ) to open gps in android by redirect to setting to set gps on
## 0.28.2:
* fix enable tracking when `trackMyPosition` is true
* add check permision when `initWithUserLocation` in `MapController` is true
Expand Down
17 changes: 14 additions & 3 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.28.2-orange)
![pub](https://img.shields.io/badge/pub-v0.29.0-orange)


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

dependencies:
flutter_osm_plugin: ^0.28.2
flutter_osm_plugin: ^0.29.0


### Migration to `0.16.0` (Android Only)
Expand Down Expand Up @@ -299,12 +299,23 @@ controller.listenerRegionIsChanging.addListener(() {
```

<b>15) Create Marker Programmatically </b>

> you can change marker icon by using attribute `markerIcon`
```dart
await controller.addMarker(GeoPoint,markerIcon:MarkerIcon,angle:pi/3);
```
<b> 15.1) Change Icon Marker </b>

> You can change marker icon by using attribute `markerIcon` of existing Marker
> The GeoPoint/Marker should be exist
```dart
await controller.setMarkerIcon(GeoPoint,MarkerIcon);
```


<b> 15.1) Remove marker </b>
<b> 15.2) Remove marker </b>

```dart
await controller.removeMarker(geoPoint);
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ packages:
path: "../flutter_osm_interface"
relative: true
source: path
version: "0.1.14+1"
version: "0.1.15"
flutter_osm_plugin:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.28.2"
version: "0.29.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion lib/src/controller/map_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MapController extends BaseMapController {
}

/// changeIconMarker
/// this method allow to change home Icon Marker
/// this method allow to change Home Icon Marker
///
/// [icon] : (MarkerIcon) widget that represent the new home marker
Future changeIconMarker(MarkerIcon icon) async {
Expand All @@ -71,6 +71,7 @@ class MapController extends BaseMapController {

/// setMarkerIcon
/// this method allow to change Icon Marker of specific GeoPoint
/// thr GeoPoint should be exist,or nothing will happen
///
/// [point] : (GeoPoint) geopoint that you want to change icon
///
Expand Down
18 changes: 11 additions & 7 deletions lib/src/widgets/mobile_osm_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,18 @@ class MobileOsmFlutterState extends State<MobileOsmFlutter>
);
}

/// requestPermission callback to request location in your phone
/// requestPermission
/// this callback has role to request location permission in your phone in android Side
/// for iOS it's done manually
Future<bool> requestPermission() async {
final locationStatus = await Permission.location.request();
if(locationStatus.isGranted){
return true;
}else if (locationStatus.isDenied){
return false;
}
if (Platform.isAndroid) {
final locationStatus = await Permission.location.request();
if (locationStatus.isGranted) {
return true;
} else if (locationStatus.isDenied) {
return false;
}
}
// _permission = await location.hasPermission();
// if (_permission == PermissionStatus.denied) {
// //request location permission
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ packages:
path: flutter_osm_interface
relative: true
source: path
version: "0.1.14+1"
version: "0.1.15"
flutter_plugin_android_lifecycle:
dependency: "direct main"
description:
Expand Down

0 comments on commit 337c9e5

Please sign in to comment.