index.js
function generatePolygon() {
  var coordNumber = getRandomNumber(3, options.maxCoordCount);

  var feature = rawFeature();
  feature.geometry.type = 'Polygon';
  feature.geometry.coordinates = [
    []
  ];

  var firstCoordinate = generateLonLat();

  feature.geometry.coordinates[0].push(firstCoordinate);
  addCoordinates(feature.geometry.coordinates[0], coordNumber - 2);
  feature.geometry.coordinates[0].push(firstCoordinate);

  return feature;
}
function generatePolygon() {
  var coordNumber = getRandomNumber(3, options.maxCoordCount);

  var feature = rawFeature();
  feature.geometry.type = 'Polygon';
  feature.geometry.coordinates = [
    []
  ];

  var firstCoordinate = generateLonLat();

  feature.geometry.coordinates[0].push(firstCoordinate);
  addCoordinates(feature.geometry.coordinates[0], coordNumber - 2);
  feature.geometry.coordinates[0].push(firstCoordinate);

  return feature;
}
function generatePolygon ( ) { var coordNumber = getRandomNumber ( 3 , options . maxCoordCount ) ; var feature = rawFeature ( ) ; feature . geometry . type = 'Polygon' ; feature . geometry . coordinates = [ [ ] ] ; var firstCoordinate = generateLonLat ( ) ; feature . geometry . coordinates [ 0 ] . push ( firstCoordinate ) ; addCoordinates ( feature . geometry . coordinates [ 0 ] , coordNumber - 2 ) ; feature . geometry . coordinates [ 0 ] . push ( firstCoordinate ) ; return feature ; }
Generates a Polygon
@return {Object} GeoJSON Polygon
Generates a Polygon