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.
size
number
Typhoon width.
alt
number
Typhoon height.
- Return - true: Creation successful. 
- false: Creation failed. 
 
var vPosition = new Module.JSVector3D(126.7824826, 35.0119469, 15.2752179);
typhoon.create(vPosition, 500.0, 150.0);createbyJson(options) → object
Creates a typhoon object.
Passes the typhoon object settings as an argument variable.
- 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 - Refer to function initPage 
 
let json = {
    id: "Typhoon",
    size: 800,
    height: 1000,
    position: new Module.JSVector3D(126.7852637, 35.0183227, 30.0),
    complete: complete,
    damage: {
        size: 500,
        altitude: 10,
        color: new Module.JSColor(200, 0, 0, 255),
        unionterrain: false,
    },
};getId() → string
Returns the ID of the object.
- Return - string: Successful return of the object's Key string. 
- null: If the object is null. 
 
lat strKey = object.getId();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.
- Sample - Refer to function moveTyphoon 
 
moveEnd()
Forces the typhoon movement to end.
Resets to the creation position after forcing the typhoon movement to end.
- Sample - Refer to function stopTyphoon 
 
moveList(list)
Sets the latitude and longitude for typhoon movement.
Sequentially moves to the entered latitude and longitude coordinates.
- Sample - Refer to function moveTyphoon 
 
var movePosition = new Module.Collection();
movePosition.add(new Module.JSVector3D(126.77599416643791, 35.02714918251881, 34.293371013365686));
movePosition.add(new Module.JSVector3D(126.78374897355015, 35.03318059967435, 35.54886215366423));
movePosition.add(new Module.JSVector3D(126.79212321528658, 35.03203801070689, 25.686076117679477));
movePosition.add(new Module.JSVector3D(126.79408620811664, 35.019259090964134, 29.999966450035572));setDamageRange(danger, size, alt, color)
Sets the damage range of the typhoon.
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.
var rangeColor = new Module.JSColor(255, 255, 255, 0);
typhoon.setDamageRange(true, 300.0, 10.0, rangeColor);setRotationSpeed(speed)
Sets the rotation speed of the typhoon.
speed
number
Typhoon rotation speed.
- Sample - Refer to function setTyphoonSpeed 
 
setSize(radius, alt)
Sets the size of the typhoon.
radius
number
Typhoon radius.
alt
number
Typhoon height.
typhoon.setSize(500.0, 150.0);setSpeed(speed)
Sets the movement speed of the typhoon.
speed
number
Typhoon movement speed.
- Sample - Refer to function setTyphoonSpeed 
 
setUnionTerrain(type)
Set whether the typhoon's impact range is combined with the terrain.
type
boolean
true: visualize terrain combination (RTT). false: visualize as a flat polygon.
- Sample - Refer to function setDamageRangeDisplay 
 
setTextureURL(url)
Sets the image URL for the typhoon. (The image supports a size of 1024*1024).
url
string
Typhoon image URL.
typhoon.setTextureURL("./image/Typhoon.png");setVisibleDamageRange(type)
Typhoon impact area visualization option.
Set whether to visualize the typhoon impact area.
type
boolean
true: Visualize the typhoon impact area. false: Hide the typhoon impact area.
- Sample - Refer to function setDamageRangeDisplay 
 
Getter / Setter
getDescription(), setDescription(desc) → string
Set a description for the object.
desc
string
Object description string.
- Return - string: Successful return of the object's description string. 
- null: If the object is null. 
 
var strDesc = object.getDescription();
// ... or ...
object.setDescription("First Object.");getName(), setName(name) → string
Sets the name of the object.
name
string
The name to set for the object.
- Return - string: Successful return of the object's name. 
- null: If the object is null. 
 
var objName = object.getName();
// ... or ...
object.setName("MyObject");getVisible(), setVisible(visible) → boolean
Sets the visibility state of an object.
visible
boolean
true: Make the object visible. false: Hide the object.
- Return - true: Object visible state. 
- false: Object hidden state. 
 
var objName = object.getName();
// ... or ...
object.setVisible(true);Type Definitions
JSTyphoon.CreateOptions
Typhoon object creation options.
id
string
Typhoon ID.
size
number
optional
500
Typhoon visualization size.
height
number
optional
100
Typhoon visualization height.
complete
function
optional
Callback function when typhoon movement is complete.
JSTyphoon.CreateOptions.Damage
Typhoon impact range object creation options.
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.
Last updated
