Skip to content

@infrared-city/sandbox-core


Class: BBox

Defined in: sandbox-core.d.ts:7

Axis-aligned bounding box in lon/lat degrees.

Indexable

[key: number]: () => void

Constructors

Constructor

new BBox(min_x, min_y, max_x, max_y): BBox

Defined in: sandbox-core.d.ts:25

Create a bounding box from its min/max corners.

Parameters

min_x

number

min_y

number

max_x

number

max_y

number

Returns

BBox

Properties

maxX

readonly maxX: number

Defined in: sandbox-core.d.ts:33

Eastern edge (maximum longitude).


maxY

readonly maxY: number

Defined in: sandbox-core.d.ts:37

Northern edge (maximum latitude).


minX

readonly minX: number

Defined in: sandbox-core.d.ts:41

Western edge (minimum longitude).


minY

readonly minY: number

Defined in: sandbox-core.d.ts:45

Southern edge (minimum latitude).

Methods

area()

area(): number

Defined in: sandbox-core.d.ts:13

Area in square degrees (width * height).

Returns

number


contains()

contains(x, y): boolean

Defined in: sandbox-core.d.ts:17

Whether the point (x, y) lies within the box (inclusive).

Parameters

x

number

y

number

Returns

boolean


free()

free(): void

Defined in: sandbox-core.d.ts:8

Returns

void


height()

height(): number

Defined in: sandbox-core.d.ts:21

Height in degrees (maxY - minY).

Returns

number


width()

width(): number

Defined in: sandbox-core.d.ts:29

Width in degrees (maxX - minX).

Returns

number