Test utilities to generate GeoJSON data.
- Source:
Methods
(static) coordinates(dataopt) → {Array.<number>}
- Source:
Generates a random pair of coordinates (longitude & latitude).
const geoJsonFixtures = require('../spec/fixtures/geojson');
geoJsonFixtures.coordinates(); // [ -76, 48 ]
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object |
<optional> |
{}
|
Custom coordinates data. Properties
|
Returns:
A GeoJSON coordinates pair.
- Type
- Array.<number>
(static) point(dataopt) → {object}
- Source:
Generates a GeoJSON point with random coordinates.
const geoJsonFixtures = require('../spec/fixtures/geojson');
geoJsonFixtures.point(); // { type: 'Point', coordinates: [ -76, 48 ] }
geoJsonFixtures.point({ coordinates }); // { type: 'Point', coordinates: [ -76, 48 ] }
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object |
<optional> |
{}
|
Custom point data. Properties
|
Returns:
A GeoJSON point.
- Type
- object