You are here

protected function WktGenerator::randomPoint in Geofield 8

Generates a random coordinates array.

Return value

array A Lon, Lat array

6 calls to WktGenerator::randomPoint()
WktGenerator::generateLinestring in src/WktGenerator.php
Generates a linestring components array.
WktGenerator::generateMultilinestring in src/WktGenerator.php
Generates a multilinestring coordinates.
WktGenerator::generateMultipoint in src/WktGenerator.php
Generates a multipoint coordinates.
WktGenerator::generateMultipolygon in src/WktGenerator.php
Generates a multipolygon coordinates.
WktGenerator::generatePolygon in src/WktGenerator.php
Generates a polygon components array.

... See full list

File

src/WktGenerator.php, line 64

Class

WktGenerator
Helper class that generates WKT format geometries.

Namespace

Drupal\geofield

Code

protected function randomPoint() {
  $lon = $this
    ->ddGenerate(-180, 180);
  $lat = $this
    ->ddGenerate(-84, 84);
  return [
    $lon,
    $lat,
  ];
}