JSEditTerrain

API for setting terrain editing functions within the map.

Created with the Module.getEditTerrain API.

var editTerrain = Module.getEditTerrain();

clear() → boolean

Resets terrain editing.

create(coordinates, height, angle) → boolean

Performs terrain cut and fill based on the analysis area.

Name
Type
Description

coordinates

List of latitude and longitude coordinates for the cut and fill analysis area.

height

number

Reference height for cut and fill (Reference: sea level, in meters)

angle

number

Slope angle for cut and fill (in degrees)

createBoundary(min, max, height, angle) → boolean

Performs terrain cut and fill based on the analysis range.

Name
Type
Description

min

Bottom left of the cut and fill area

max

Top right of the cut and fill area

height

number

Reference height for cut and fill (Reference: sea level, in meters)

angle

number

Slope angle for cut and fill (in degrees)

setEditFaceColor(data, width, height, type) → boolean

Sets the texture for the ground and slope surfaces during terrain cut and fill.

The data variable is based on a binary array of Uint8Array.

Name
Type
Description

data

object

Image binary data.

width

number

Width of the image.

height

number

Height of the image.

type

boolean

Differentiates between ground and slope (true: ground, false: slope)

Last updated