google_map_polyutil 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 75

google_map_polyutil #

Dart bridge between native google map utility class PolyUtil and your application.

Now you can use all PolyUtil methods that are available in google map utility class PolyUtil.

Usage #

Import package:google_map_polyutil/google_map_polyutil.dart and then you are all set to call all it's static methods.

Methods available #

  • containsLocation [Future
  • decode [Future<List
  • distanceToLine [Future
  • encode [Future
  • isClosedPolygon [Future
  • isLocationOnEdge [Future
  • isLocationOnPath [Future
  • simplify Future<List

Example #

// Let's prepare dummy arguments.
List<LatLng> 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);

String encodedString = "???_ibE?_seK?_ibE";

containsLocation #

GoogleMapPolyUtil.containsLocation(
	point: point,
    polygon: paths
).then((result) => print(result));

decode #

GoogleMapPolyUtil.decode(
	encodedPath: encodedPath
).then((result) => print(result));

distanceToLine #

GoogleMapPolyUtil.distanceToLine(
	point: LatLng(0, 0),
    start: LatLng(0, 0),
    end: LatLng(0, 8)
).then((result) => print(result));

encode #

GoogleMapPolyUtil.encode(
	path: paths
).then((result) => print(result));

isClosedPolygon #

GoogleMapPolyUtil.isClosedPolygon(
	poly: path,
    polygon: paths
).then((result) => print(result));

isLocationOnEdge #

GoogleMapPolyUtil.isLocationOnEdge(
	point: point,
    polygon: paths
).then((result) => print(result));

isLocationOnPath #

GoogleMapPolyUtil.isLocationOnEdge(
	point: point,
    polygon: paths
).then((result) => print(result));

simplify #

GoogleMapPolyUtil.simplify(
	poly: paths,
    tolerance: 100
).then((result) => print(result));

Author #

Ashim Upadhaya

Note : This plugin can only be used for android application. iOS support in not available yet.

0.0.1 #

  • Initial release

1.0.0 #

  • Modified codes a bit for concrete release.

example/README.md

google_map_polyutil_example #

Demonstrates how to use the google_map_polyutil plugin.

Example #

// Let's prepare dummy arguments.
List<LatLng> 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);

String encodedString = "???_ibE?_seK?_ibE";

containsLocation #

GoogleMapPolyUtil.containsLocation(
	point: point,
    polygon: paths
).then((result) => print(result));

decode #

GoogleMapPolyUtil.decode(
	encodedPath: encodedPath
).then((result) => print(result));

distanceToLine #

GoogleMapPolyUtil.distanceToLine(
	point: LatLng(0, 0),
    start: LatLng(0, 0),
    end: LatLng(0, 8)
).then((result) => print(result));

encode #

GoogleMapPolyUtil.encode(
	path: paths
).then((result) => print(result));

isClosedPolygon #

GoogleMapPolyUtil.isClosedPolygon(
	poly: path,
    polygon: paths
).then((result) => print(result));

isLocationOnEdge #

GoogleMapPolyUtil.isLocationOnEdge(
	point: point,
    polygon: paths
).then((result) => print(result));

isLocationOnPath #

GoogleMapPolyUtil.isLocationOnEdge(
	point: point,
    polygon: paths
).then((result) => print(result));

simplify #

GoogleMapPolyUtil.simplify(
	poly: paths,
    tolerance: 100
).then((result) => print(result));

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  google_map_polyutil: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:google_map_polyutil/google_map_polyutil.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
49
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
google_maps_flutter ^0.5.21+15 0.5.24+1
meta ^1.1.8 1.1.8
Transitive dependencies
collection 1.14.11 1.14.12
flutter_plugin_android_lifecycle 1.0.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test