Skip to content

KBE3D / KBCore / turf / randomPosition

函数: randomPosition()

randomPosition(bbox?: BBox | { bbox: BBox; }): Position

Function

Returns a random position within a bounding box.

参数

bbox?

a bounding box inside of which positions are placed.

BBox | { bbox: BBox; }

返回

Position

Position [longitude, latitude]

抛出

if bbox is invalid

示例

ts
var position = turf.randomPosition([-180, -90, 180, 90])
// => position

KBE3D @3.0.0 Copyright © 2024-present KBE3D