JSTyphoon

API for creating and modifying typhoon objects.

Create a API with Module.createTyphoon.

var object = Module.createTyphoon("id");

Function

create(position, size, alt) → boolean

Sets the position and size of the typhoon object.

Name
Type
Description

position

typhoon location coordinates (longitude, latitude, altitude).

size

number

Typhoon width.

alt

number

Typhoon height.

  • Return

    • true: Creation successful.

    • false: Creation failed.

createbyJson(options) → object

Creates a typhoon object.

Passes the typhoon object settings as an argument variable.

Name
Type
Description

option

Initialization option property information.

  • Return

    • .result: API success status (1: Success, 0: Failure)

    • .name: Operation API name

    • .return: API return information (object: Normal return value, string: Failure error code)

  • Sample

getId() → string

Returns the ID of the object.

  • Return

    • string: Successful return of the object's Key string.

    • null: If the object is null.

moveStart()

Starts the typhoon movement.

Moves the typhoon to the latitude and longitude coordinates added to the JSTyphoon API moveList.

Resets to the creation position after the typhoon movement event ends.

moveEnd()

Forces the typhoon movement to end.

Resets to the creation position after forcing the typhoon movement to end.

moveList(list)

Sets the latitude and longitude for typhoon movement.

Sequentially moves to the entered latitude and longitude coordinates.

Name
Type
Description

list

List of longitude, latitude, altitude coordinates.

setDamageRange(danger, size, alt, color)

Sets the damage range of the typhoon.

Name
Type
Description

danger

boolean

Set the threat/warning type. true: Set the damage range type to 'Danger' level. false: Sets the damage range type to 'warning' level.

size

number

Damage range.

alt

number

Altitude of range display.

color

Display color.

setRotationSpeed(speed)

Sets the rotation speed of the typhoon.

Name
Type
Description

speed

number

Typhoon rotation speed.

setSize(radius, alt)

Sets the size of the typhoon.

Name
Type
Description

radius

number

Typhoon radius.

alt

number

Typhoon height.

setSpeed(speed)

Sets the movement speed of the typhoon.

Name
Type
Description

speed

number

Typhoon movement speed.

setUnionTerrain(type)

Set whether the typhoon's impact range is combined with the terrain.

Name
Type
Description

type

boolean

true: visualize terrain combination (RTT). false: visualize as a flat polygon.

setTextureURL(url)

Sets the image URL for the typhoon. (The image supports a size of 1024*1024).

Name
Type
Description

url

string

Typhoon image URL.

setVisibleDamageRange(type)

Typhoon impact area visualization option.

Set whether to visualize the typhoon impact area.

Name
Type
Description

type

boolean

true: Visualize the typhoon impact area. false: Hide the typhoon impact area.

Getter / Setter

getDescription(), setDescription(desc) → string

Set a description for the object.

Name
Type
Description

desc

string

Object description string.

  • Return

    • string: Successful return of the object's description string.

    • null: If the object is null.

getName(), setName(name) → string

Sets the name of the object.

Name
Type
Description

name

string

The name to set for the object.

  • Return

    • string: Successful return of the object's name.

    • null: If the object is null.

getVisible(), setVisible(visible) → boolean

Sets the visibility state of an object.

Name
Type
Description

visible

boolean

true: Make the object visible. false: Hide the object.

  • Return

    • true: Object visible state.

    • false: Object hidden state.

Type Definitions

JSTyphoon.CreateOptions

Typhoon object creation options.

Name
Type
Attributes
Default
Description

id

string

Typhoon ID.

position

Typhoon location coordinates (longitude, latitude, altitude).

size

number

optional

500

Typhoon visualization size.

height

number

optional

100

Typhoon visualization height.

complete

function

optional

Callback function when typhoon movement is complete.

damage

optional

Typhoon impact range creation property information.

JSTyphoon.CreateOptions.Damage

Typhoon impact range object creation options.

Name
Type
Attributes
Default
Description

size

number

optional

500

Impact range visualization size (in meters).

altitude

number

optional

10

Impact range visualization altitude (in meters).

unionterrain

boolean

optional

false

Whether the impact range visualization combines with the terrain.

color

optional

JSColor(200, 255, 0, 0)

Impact range visualization color.

Last updated