I’m trying to solve a problem about Point and Boundary.
My problem:
- I setup a Map where user can tap to pin a marker, whenever user pin a marker, I will send that marker LatLng server to check whether that marker is valid or not. “Valid” here means that it lies in the boundary ( which is a city / district that admin will specify in the admin page ) and I can do this with the API from Map service provides.
- Is there anyway I can check this locally? Because I don’t want to call API so many times (everytime user pin a marker ) I read about LatLng bounds but a district / city have many points ( many LatLong instead of a box from 4 LatLng). So there are 2 problems here I’m trying to solve, how can I find a boundary of a city / district, and how can I determine whether my marker lies in that boundary or not.
I’m trying to solve by using LatlngBounds but it seems this bounds usally use in 4 points