{"id":23222672,"url":"https://github.com/ayyshim/google_map_polyutil","last_synced_at":"2025-08-19T11:32:39.399Z","repository":{"id":56831540,"uuid":"234522248","full_name":"ayyshim/google_map_polyutil","owner":"ayyshim","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-13T12:05:22.000Z","size":67,"stargazers_count":8,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-20T22:15:35.027Z","etag":null,"topics":["android","dart","dartlng","decodes","flutter","flutter-plugin","flutter-plugins","latlngs","meters","polygon","polyline","polyutil","tolerance"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayyshim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-17T10:04:46.000Z","updated_at":"2021-01-27T02:42:02.000Z","dependencies_parsed_at":"2022-08-28T20:10:52.199Z","dependency_job_id":null,"html_url":"https://github.com/ayyshim/google_map_polyutil","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyshim%2Fgoogle_map_polyutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyshim%2Fgoogle_map_polyutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyshim%2Fgoogle_map_polyutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyshim%2Fgoogle_map_polyutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayyshim","download_url":"https://codeload.github.com/ayyshim/google_map_polyutil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230351179,"owners_count":18212790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dart","dartlng","decodes","flutter","flutter-plugin","flutter-plugins","latlngs","meters","polygon","polyline","polyutil","tolerance"],"created_at":"2024-12-18T23:13:47.497Z","updated_at":"2024-12-18T23:13:48.122Z","avatar_url":"https://github.com/ayyshim.png","language":"Dart","readme":"# google_map_polyutil\n\nDart bridge between native google map utility class PolyUtil and your application.\n\nNow you can use all PolyUtil methods that are available in google map utility class PolyUtil.\n\n# Usage\n\nImport `package:google_map_polyutil/google_map_polyutil.dart` and then you are all set to call all it's static methods.\n\n# Methods available\n\n* `containsLocation` [Future\u003cbool\u003e] : Computes whether the given point lies inside the specified polygon.\n* `decode` [Future\u003cList\u003cLatLng\u003e\u003e] : Decodes an encoded path string into a sequence of LatLngs.\n* `distanceToLine` [Future\u003cdouble\u003e] : Computes the distance on the sphere between the point p and the line segment start to end.\n* `encode` [Future\u003cString\u003e] :  Encodes a sequence of LatLngs into an encoded path string.\n* `isClosedPolygon` [Future\u003cbool\u003e] : Returns true if the provided list of points is a closed polygon (i.e., the first and last points are the same), and false if it is not.\n* `isLocationOnEdge` [Future\u003cbool\u003e] : Computes whether the given point lies on or near the edge of a polygon, within a specified tolerance in meters.\n* `isLocationOnPath` [Future\u003cbool\u003e] : Computes whether the given point lies on or near a polyline, within a specified tolerance in meters.\n* `simplify` Future\u003cList\u003cLatLng\u003e\u003e : Simplifies the given poly (polyline or polygon) using the Douglas-Peucker decimation algorithm.\n\n# Example\n\n```dart\n// Let's prepare dummy arguments.\nList\u003cLatLng\u003e paths = [];\npaths.add(LatLng(0,0));\npaths.add(LatLng(0,1));\npaths.add(LatLng(0,2));\npaths.add(LatLng(0,4));\n\n// Coordinate you want to check if it lies within or near path.\nLatLng point = LatLng(0, 3);\n\nString encodedString = \"???_ibE?_seK?_ibE\";\n```\n\n###  containsLocation\n\n```dart\nGoogleMapPolyUtil.containsLocation(\n\tpoint: point,\n    polygon: paths\n).then((result) =\u003e print(result));\n```\n\n### decode\n\n```dart\nGoogleMapPolyUtil.decode(\n\tencodedPath: encodedPath\n).then((result) =\u003e print(result));\n```\n\n### distanceToLine\n\n```dart\nGoogleMapPolyUtil.distanceToLine(\n\tpoint: LatLng(0, 0),\n    start: LatLng(0, 0),\n    end: LatLng(0, 8)\n).then((result) =\u003e print(result));\n```\n\n### encode\n\n```\nGoogleMapPolyUtil.encode(\n\tpath: paths\n).then((result) =\u003e print(result));\n```\n\n### isClosedPolygon\n\n```dart\nGoogleMapPolyUtil.isClosedPolygon(\n\tpoly: path,\n    polygon: paths\n).then((result) =\u003e print(result));\n```\n\n### isLocationOnEdge\n\n```\nGoogleMapPolyUtil.isLocationOnEdge(\n\tpoint: point,\n    polygon: paths\n).then((result) =\u003e print(result));\n```\n\n### isLocationOnPath\n\n```dart\nGoogleMapPolyUtil.isLocationOnEdge(\n\tpoint: point,\n    polygon: paths\n).then((result) =\u003e print(result));\n```\n\n### simplify\n\n```dart\nGoogleMapPolyUtil.simplify(\n\tpoly: paths,\n    tolerance: 100\n).then((result) =\u003e print(result));\n```\n\n# Author\n\n[Ashim Upadhaya](https://github.com/ayyshim)\n\n\u003e *Note : This plugin can only be used for android application. iOS support in not available yet.* ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayyshim%2Fgoogle_map_polyutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayyshim%2Fgoogle_map_polyutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayyshim%2Fgoogle_map_polyutil/lists"}