JSGridAnal

API for creating and setting grid analysis objects within the map.

Create a API with Module.getGridAnal.

var object = Module.getAnalysis().getGridAnal();

clear()

Clears all current grid analysis results.

openGridDataURL(url, time, size, start, end, type)

Calls binary grid analysis result data from a URL.

The time input value range includes integer indices starting from 0, 0-based array number.

The size input value range is any positive integer representing byte size.

The start input value range is the byte offset to start reading data from each cell's starting pointer.

The end input value range is the byte offset to stop reading data from each cell's starting pointer.

The size of the cell to read = (end - start), in bytes.

Information according to type input value: 0 (integer 4 bytes), 1 (float 4 bytes), 2 (float 8 bytes).

Name
Type
Description

url

string

HTTP request file URL.

time

number

Time series index of the analysis result data.

size

number

Byte size of grid data cell (integer).

start

number

Start offset to collect data cell (integer).

end

number

End offset to collect data cell (integer).

type

number

Data type (integer).

  • Return

    • Asynchronous event - Fires EventLoadDataFinish when all time series data is loaded

  • Sample

setHRange(min, max)

Sets the minimum and maximum values for displaying grid analysis result data.

Name
Type
Description

min

number

Minimum value.

max

number

Maximum value.

createRasterData(name, time) → boolean

Creates a 2D Raster object from binary grid analysis result data at the specified time index.

The name input value must not duplicate previous key values.

The time input value is an integer time index greater than or equal to 0, cannot exceed setTimeRange value.

If setLayerName("layer_name") API layer name is not specified, it is added to the UserLayer.

Name
Type
Description

name

string

Key value for the created object.

time

number

Time series index number (integer).

createPlaneData(name) → boolean

Creates a 3D animation plane object from binary grid analysis result data.

The name input value must not duplicate previous key values.

By default, the animation runs from time series index 0 to the maximum time series count upon creation.

Name
Type
Description

name

string

Key value for the created object.

createArrowData(time) → boolean

Creates 3D arrow objects from binary grid analysis result data at the specified time series index.

The time input value is an integer greater than or equal to 0, cannot exceed the value set by setTimeRange.

Name
Type
Description

time

number

Time series index number (integer).

setTimeRange(time)

Sets the total number of time series for binary grid analysis result data.

The time input value requires an integer greater than 1, default is 6.

Changes to the setting must be applied before requesting binary grid analysis data.

Name
Type
Description

time

number

Total number of time series (integer).

setHRatio(ratio)

Adjusts the height ratio of shapes represented by numerical values in 3D animation plane objects.

The ratio input value can be applied after creating 3D animation plane objects, must be a value greater than 0.

Name
Type
Description

ratio

number

Height ratio value.

setTime(time)

Resets the time series index for 3D animation plane objects.

The time input value ranges from 0 to the total number of time series minus 1 (0-base Index).

As the numerical value changes, the time series animation flows and changes, flowing from 0 to 6, reaching up to 5 before reaching 6.

Name
Type
Description

time

number

Time series index. (integer)

getTime() → number

Returns the current ongoing time series index for 3D animation plane objects.

  • Return

    • Returns the information of the current time series index being performed in the animation (integer).

clearLegend()

Resets the set legend values.

Initializes the grid color legend applied to 2D Raster objects and 3D animation plane objects.

addLegendColor(alpha, red, green, blue) → number

Adds a legend color to the legend list.

alpha, red, green, blue: ARGB, integer color range 0~255.

The legend applies each grid value proportionally based on the total number of the legend list from the grid's minimum to maximum value.

Name
Type
Description

alpha

number

Transparency value (integer)

red

number

Red color value (integer)

green

number

Green color value (integer)

blue

number

Blue color value (integer)

set3DArrowSizeRatio(ratio)

Changes the arrow size ratio of 3D arrow objects.

The ratio input value must be greater than 0, defining the size as a scale relative to the grid size.

The setting must be applied before creating 3D arrow objects.

Name
Type
Description

ratio

number

Arrow size ratio change

openGridDataJSON(options) → boolean

Setting grid result data in JSON format.

Name
Type
Description

options

Grid information setting values

setLayerName(name)

Specifies the layer name for creating 3D map objects from grid analysis result data.

If the name input value is "", it applies to the user layer; if specified, it creates and applies to a layer from the local layer list.

Name
Type
Description

name

string

Layer name.

Type Definitions

JSGridAnal.GridDataOption

Grid data request parameters

Name
Type
Attributes
Default
Description

kind

string

Grid data group name

timeIndex

number

Grid data time series index number (integer)

timeRange

number

Total number of time series for grid data (integer)

callback

function

optional

Callback function triggered when all grid data is loaded

cols

number

Total number of horizontal cells in the grid (integer)

rows

number

Total number of vertical cells in the grid (integer)

llcorner

Lower left spatial coordinate object

size

number

Size of grid cell (width, height in meters)

fMin

number

Minimum value of grid cell

fmax

number

Maximum value of grid cell

data

array(number)

Data array for grid cell

JSGridAnal.GridDataOption.llcornerParam

Spatial range setting parameters for the grid

Name
Type
Attributes
Default
Description

projNum

number

Coordinate system code number

pos

array(number)

Coordinate range array in the format [[minx, miny], [maxx, maxy]]

Last updated