In Javascript (Client side), I could find out whether the given latitude and longitude is inside or outside the drawn shape by the contains method of google.maps.LatLngBounds
class.
On the server side, is it possible to check whether the given coordinate is inside or outside the shape?
I believe you do not need any function to check it out. Simple logic could do that.
Please try out the logic below.
FOR RECTANGLE
public void rectangleRegionChecker() {
double Given_Lattitude;
double Given_Longtitude;
double SouthWestLattitude;
double SouthWestLongtitude;
double NorthEastLattitude;
double NorthEastLongitude;
if((SouthWestLattitude<=Given_lattitude)&&(SouthWestLongtitude<=Given_Longtitude)&&(NorthEastLattitude>=Given_Lattitude)&&(NorthEastLongtitude>=Given_Longtitude)){
S.O.P("Inside the Rectangle");
}
}
I believe this will help you a lot.