google_map_polyutil 1.0.1 copy "google_map_polyutil: ^1.0.1" to clipboard
google_map_polyutil: ^1.0.1 copied to clipboard

Dart implementation of native google map utility class PolyUtil

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";
copied to clipboard

containsLocation #

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

decode #

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

distanceToLine #

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

encode #

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

isClosedPolygon #

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

isLocationOnEdge #

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

isLocationOnPath #

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

simplify #

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

Author #

Ashim Upadhaya

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

26
likes
40
points
48
downloads

Publisher

verified publisheruashim.com.np

Weekly Downloads

2024.09.13 - 2025.03.28

Dart implementation of native google map utility class PolyUtil

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, google_maps_flutter, meta

More

Packages that depend on google_map_polyutil