• JMap.Geometry.checkPolygon

    Throw an error if the provided parameter is not a valid polygon.

    Parameters

    • polygon: JPolygon

      The polygon array to check

    Returns void

    Example

    let polygon = [[ 10, 10 ], [ 11, 11 ], [ 12, 12 ], [ 10, 10 ]]
    // The following instruction will not throw an error
    JMap.Geometry.checkPolygon(polygon)

    polygon = [] // empty array
    // The following instruction will throw an error
    JMap.Geometry.checkPolygon(polygon)