public static boolean isPolygon(OMPoly omPoly){
  double[] points=omPoly.getLatLonArray();
  int i=points.length;
  boolean isPolygon=false;
  if (points != null && i > 5) {
    isPolygon=points[0] == points[i - 2] && points[1] == points[i - 1];
    isPolygon=isPolygon && omPoly.isPolygon();
  }
  return isPolygon;
}

public static boolean isPolygon ( OMPoly omPoly ) { double [ ] points = omPoly . getLatLonArray ( ) ; int i = points . length ; boolean isPolygon = false ; if ( points != null && i > 5 ) { isPolygon = points [ 0 ] == points [ i - 2 ] && points [ 1 ] == points [ i - 1 ] ; isPolygon = isPolygon && omPoly . isPolygon ( ) ; } return isPolygon ; }
takes an ompoly as the parameter and checks whether or not it is a polygon or polyline . < br > < br > this method incorporates the ompoly . ispolygon ( ) method which returns true if the fill color is not clear , but also checks the first set and last set of lat / lon points of the float [ ] defined by ompoly . getlatlonarray ( ) . returns true for a polygon and false for a polyline .
