Reputation: 23
I create map, where as user can draw the boundaries(polygon) of his area, and give exact geo-location by placing pin(marker). but my problem is that when i create this before it check the marker is inside the polygon or not.
Upvotes: 1
Views: 1211
Reputation: 1
No need to use ext libraries
Polygon poly = ....;
onTap: (tapPosition,latlng) {
setState(() {
if(poly.boundingBox.contains(latlng)){
log("point inside the edge")
}
});
},
Upvotes: 0
Reputation: 339
You can use point_in_polygon package and simply pass your point and point of polygon.
Poly.isPointInPolygon(pointToCheckIfInPolygon, pointsOfPolygon)
Upvotes: 1