https://github.com/ayyshim/lop_polyutil
Checkout new and extended version of this plugin
https://github.com/ayyshim/lop_polyutil
flutter flutter-plugin polyutil
Last synced: about 1 month ago
JSON representation
Checkout new and extended version of this plugin
- Host: GitHub
- URL: https://github.com/ayyshim/lop_polyutil
- Owner: ayyshim
- License: other
- Created: 2020-01-16T12:08:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-16T12:23:57.000Z (over 6 years ago)
- Last Synced: 2025-12-19T12:28:13.869Z (6 months ago)
- Topics: flutter, flutter-plugin, polyutil
- Language: Java
- Homepage: https://pub.dev/packages/google_map_polyutil
- Size: 128 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# lop_polyutil
**LopPolyutil** is an implementation of `isLocationOnPath()` google map PolyUtil method.
## Usage
Import `package:lop_polyutil/lop_polyutil.dart` and then call a static method `isLocationOnPath` which will return a _boolean_.
```dart
// import package
import 'package:lop_polyutil/lop_polyutil.dart';
// Prepare arguments to pass.
// It takes 2 @required and 1 optional arguments.
// List of LatLng
List paths = [];
paths.add(LatLng(0,0));
paths.add(LatLng(0,1));
paths.add(LatLng(0,2));
paths.add(LatLng(0,4));
// Coordinate you want to check if it lies within or near path.
LatLng point = LatLng(0, 3);
// radius is optional argument. By default radius is set at 200 meters.
double radius = 200;
// isLocationOnPath a Future method so we will use .then()
LopPolyutil.isLocationOnPath(path: paths, point: point, radius: radius)
.then((result) {
if(result == true) {
// things you can do when point is within or near path goes here...
} else {
// things you can do when point isn't within or near path goes here...
}
});
```
## Author
**[Ashim Upadhaya](https://github.com/ayyshim)**
#### Note
This plugin is not supported by ios yet.