I using google_maps_flutter library on my flutter project, I created a polygon but i wanted to check if a coordinate is within a polygon... how can i do this?
That is google widget
GoogleMap(
myLocationButtonEnabled: false,
myLocationEnabled: true,
mapToolbarEnabled: false,
polygons: myPolygon(),
mapType: MapType.normal,
initialCameraPosition: _initialCamera,
onMapCreated: _onMapCreated,
onCameraMove: _onCameraMove,
onCameraIdle: _onCameraIdle,
),
Please how can i check if a coordinate is within the polygon
You can use the PolyUtil.containsLocation method on the Maps SDK for Android Utility Library. Here is the reference documentation.
And, with flutter, you can use all PolyUtil methods that are available in google map utility class PolyUtil by using the google_map_polyutil 1.0.0 package that can be found here.
I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With