JSLayer

API for managing objects within a map.

Can be created with the Module createLayer API.

User layers can be created with the Module createObjectLayer API.

Service layers can be created with the Module createXDServerLayer API.

let layerList = new Module.JSLayerList(true);
let layer = layerList.createLayer("Layer Name");

Properties

Name
Type
Description

altitude_offset

number

Real-time height setting for point cloud, drone LOD data.

lod_object_alpha

number

Set alpha value for service layer properties.

lod_object_detail_ratio

number

Set visibility distance ratio for service layer objects.

serverURL

string

Returns request server URL.

simple_real3d

boolean

Set building object simple mode.

text_character_set

string

Set layer text character set value.

tile_load_ratio

number

Set visibility distance ratio for service layer.

Function

addObject(object, level)

Add an object to the user layer.

Only available for user layers.

Use level 0 consistently.

Name
Type
Description

object

Add created object

level

number

Use value 0

clearWMSCache()

Clears the cache of loaded WMS layer images.

getObjectCount() → number

Returns the number of objects in the layer.

Only available for user layers.

  • Return

    • -1 : If there are no objects in the layer.

    • result>0 : Number of objects in the layer.

getObjectKeyList() → string

Returns the names of objects in the layer.

Manages objects in the user layer as a list and returns the names of all list objects.

Available for user layers.

  • Return

    • string : Successfully returns object names (separator ",").

    • "" : Fails to return object names.

    • Failure conditions

      • If the number of objects in the layer is 0.

      • In the case of service layers (objects in service layers are dependent on tiles).

getType() → number

Returns the type value of the layer.

  • Return

    • number(0 or higher) : Returns the layer type (Layer Type List).

    • number(-1) : If the layer object does not exist.

indexAtKey(index) → string

Returns the object ID in the user layer.

Manages objects in the user layer as a list and returns the object ID corresponding to the list Index.

Only available for user layers.

Name
Type
Description

index

number

Target object Index.

  • Return

    • string : Successfully returns the object ID corresponding to the Index.

    • "" : Fails to return the object ID corresponding to the Index.

    • Failure conditions

      • If the Index exceeds the range of the object list (less than 0 or greater than the number of objects in the list).

indexAtObject(index) → JSObject

Returns the object in the user layer.

Manages objects in the user layer as a list and returns the object corresponding to the list index.

Only available for user layers.

Name
Type
Description

index

number

Index of the registered object.

  • Return

    • JSObject : Successfully returns the object corresponding to the Index.

    • null : Fails to return the object corresponding to the Index.

    • Failure conditions

      • If the Index exceeds the range of the object list (less than 0 or greater than the number of objects in the list).

      • If the number of objects in the layer is 0.

keyAtObject(name) → JSObject

Returns the object in the user layer.

Manages objects in the user layer as a list and sequentially compares the object ID with objectid, returning the matching object.

Only available for user layers.

Name
Type
Description

name

string

Name of the registered object.

  • Return

    • JSObject : Successfully returns the object with the same name.

    • null : Fails to return the object with the same name.

    • Failure conditions

      • If there is no object with the same name.

      • If there is no string data for name.

      • If the number of objects in the layer is 0.

removeAtIndex(index) → boolean

Deletes an object in the user layer.

Manages objects in the user layer as a list and deletes the object corresponding to the list Index.

Only available for user layers.

Name
Type
Description

index

number

Index of the registered object.

  • Return

    • true : Successfully deletes the object.

    • false : Fails to delete the object.

    • Failure conditions

      • If the index exceeds the range of the object list (less than 0 or greater than the number of objects in the list).

      • If the number of objects in the layer is 0.

      • In the case of a service layer (objects in service layers are dependent on tiles).

      • If the data was loaded through an external server (e.g., WMS, WFS).

removeAtKey(name) → boolean

Deletes an object in the user layer.

Manages objects in the user layer as a list and sequentially compares the object name with name, then deletes the matching object.

Only available for user layers.

Name
Type
Description

name

string

Name of the registered object.

  • Return

    • true : Successfully deletes the object.

    • false : Fails to delete the object.

    • Failure conditions

      • If there is no object with the same objectid.

      • If there is no string data for name.

      • If the number of objects in the layer is 0.

      • In the case of a service layer (objects in service layers are dependent on tiles).

      • If the data was loaded through an external server (e.g., WMS, WFS).

removeAtObject(object) → boolean

Deletes an object in the user layer.

Manages objects in the user layer as a list and sequentially compares the object with object, then deletes the matching object.

Only available for user layers.

Name
Type
Description

object

Registered object.

  • Return

    • true : Successfully deletes the object.

    • false : Fails to delete the object.

    • Failure conditions

      • If there is no object identical to object.

      • If the number of objects in the layer is 0.

      • In the case of a service layer (objects in service layers are dependent on tiles).

      • If the data was loaded through an external server (e.g., WMS, WFS).

removeAll() → boolean

Deletes all objects in the user layer.

Deletes the entire object list in the layer.

Only available for user layers.

  • Return

    • true : Successfully deletes the objects.

    • false : Fails to delete the objects.

    • Failure conditions

      • If the number of objects in the layer is 0.

      • In the case of a service layer (objects in service layers are dependent on tiles).

      • If the data was loaded through an external server (e.g., WMS, WFS).

setConnectionWFS(url, port, param) → boolean

Sets the connection information for a WFS layer.

Name
Type
Description

url

string

Data request URL.

port

number

Data request Port.

param

string

Data request parameters.

  • Return

    • true : If successfully set.

    • false : If the layer does not exist or if the layer type is not a tile layer type.

setConnectionWMS(url, port, param) → boolean

Sets the connection information for a WMS layer.

Name
Type
Description

url

string

Data request URL.

port

number

Data request Port.

param

string

Data request parameters.

  • Return

    • true : If successfully set.

    • false : If the layer does not exist or if the layer type is not a tile layer type.

setFontStyle(fontName, fontSize, fontWeight, color, outColor)

Sets the font style for WFS.

Name
Type
Description

fontName

string

Font name.

fontSize

number

Font size.

fontWeight

number

Font weight.

color

Font color.

outColor

Font outline color.

setLevelWFS(level)

Sets the data output level range for a WFS layer.

Name
Type
Description

level

number

Maximum data output level.

setLevelWMS(minLevel, maxLevel) → boolean

Sets the data output level range for a WMS layer.

Name
Type
Description

minLevel

number

Minimum data output level.

maxLevel

number

Maximum data output level.

  • Return

    • true : If successfully set.

    • false : If the layer does not exist or if the layer type is not a tile layer type.

setLODRatio(ratio)

Sets the visibility range for the layer.

Adjusts object visibility by changing the LOD of the service layer.

Only available for service layers.

Name
Type
Description

ratio

number

LOD level setting (higher values increase visibility range).

setProxyRequest(type)

Sets the use of a proxy for the layer.

Sets whether to use a proxy for object communication requests.

Only available for service layers.

Name
Type
Description

type

boolean

true to use a proxy server, false for default request settings.

  • Return

    • true : If proxy setting is successful.

    • false : If proxy setting fails.

    • Failure conditions

      • In the case of a user layer.

  • Sample

setRecoverHsvValue(hue, saturation, value) → boolean

Sets the HSV color channel for the service layer.

Sets object HSV channel visualization with input values for color (hue), saturation, and brightness (value).

Applicable only to buildings and drone LOD layers.

Name
Type
Description

hue

number

HSV channel (hue).

saturation

number

HSV channel (saturation).

value

number

HSV channel (value).

  • Return

    • true : If HSV channel setting is successful.

    • false : If HSV channel setting fails.

  • Sample

setRequestFeatureCount(count)

Specifies the tile size for WFS data requests.

Name
Type
Description

count

number

Request unit tile size.

  • Return

    • true : If successfully set.

    • false : If the layer type is not a tile layer type or not a WFS layer type.

  • Note

    • The larger the request unit, the larger the tile range for WFS data requests.

setStylesWMS(style)

Sets the style of the layer to request.

Name
Type
Description

style

string

Request layer style.

  • Return

    • true : If successfully set.

    • false : If the layer does not exist or if the layer type is not a tile layer type.

setTileAltitudeOffset(offset) → boolean

Sets the initial altitude value for the service (default 0).

Sets the height of objects when loading based on the initial altitude (offset). The height of visible objects does not change.

Applicable only to point cloud layers.

The height altitude setting varies depending on the offset input value: tilt<0 (rise), 0 (original altitude), tilt>0 (descend).

Name
Type
Description

offset

number

Altitude setting for the point cloud.

  • Return

    • true : If height setting is successful.

    • false : If height setting fails.

  • Sample

setTileSizeWMS(size)

Set the pixel size of the WMS layer tile.

Name
Type
Description

size

number

Pixel size of the tile.

  • Return

    • true : If successfully set.

    • false : If the layer does not exist or if the layer type is not a tile layer type.

setUseRecoverHsv(type) → boolean

Sets the color representation for the service layer.

Sets object representation using the HSV color channel.

Applicable only to buildings and drone LOD layers.

Name
Type
Description

type

boolean

true for HSV channel visualization false for default visualization.

  • Return

    • true : If HSV channel visualization setting is successful.

    • false : If HSV channel visualization setting fails.

  • Sample

setWFSDescField(fieldName) → boolean

Sets the tag name to store as Description data among WFS data.

Name
Type
Description

fieldName

string

Tag name to store as Description data.

  • Return

    • true : If successfully set.

    • false : If the layer type is not a tile layer type or not a WFS type layer.

setWFSPointName(fieldName)

Set the POI visualization string tag name in the XML format requested from the WFS service layer.

Name
Type
Description

fieldName

string

tag name.

  • Return

    • true: Setup successful.

    • false: Setting failure.

    • Failure conditions

      • If it is not a service layer.

      • If it is not a WFS layer type.

setWFSPropertyName(propertyName)

Sets the list of tags to receive as property data for WFS.

Name
Type
Description

propertyName

string

Property data tag list.

  • Return

    • true : If successfully set.

    • false : If the layer type is not a tile layer type or not a WFS type layer.

  • Note

    • The set WFS tag list is applied to the “propertyname” parameter among WFS data request parameters.

setWFSTextColor(lineColor, fillColor)

Sets the outline and fill colors of text for POI WFS data output.

Name
Type
Description

lineColor

Text outline color.

fillColor

Text fill color.

  • Return

    • true : If successfully set.

    • false : If the layer type is not a tile layer type or not a WFS type layer.

setWMSProvider(option) → string

Creates a WMS layer

Creates a WMS service layer with the argument variable options.

Name
Type
Description

option

WMS request property information.

  • Return

    • success : If WMS layer creation is successful.

    • string : Error message during WMS layer creation process.

  • Sample

setWMSTransparent(transparent)

Sets the transparency of the WMS layer.

Name
Type
Description

transparent

boolean

Layer output mode. true: Layer output in semi-transparent mode false: Layer output in opaque mode

  • Note

    • If set to true, the terrain image is also visible in a semi-transparent state, while setting to false will output the layer in an opaque state without showing the terrain image.

setWMSVersion(version)

Sets the request version for WMS images.

Name
Type
Description

version

string

The data request version to set.

  • Return

    • true : If successfully set.

    • false : If the layer does not exist or if the layer type is not a tile layer type.

Getter / Setter

getAlpha(), setAlpha(alpha) → number

Sets the transparency of objects existing in the service building layer.

Sets the transparency of objects in simple mode of the service building layer.

Name
Type
Description

alpha

number

Set alpha value for service layer properties

  • Conditions for transparency setting failure

    • In the case of a user layer.

    • For service layers other than buildings.

getBBoxOrder(), setBBoxOrder(type) → boolean

Sets options for a WMS service layer.

Sets the visualization option for coordinate information requested to the GeoServer.

Available for WMS layers.

Depending on the input value type, coordinate information is set as true(BBOX=minx,miny,maxx,maxy), false(BBOX=minY,minX,maxY,maxX).

Name
Type
Description

type

boolean

Coordinate option setting.

getEditable(), setEditable(edit) → boolean

Sets the layer as an editing layer.

A layer that manages objects created within the engine.

Only available for user layers.

Changing to an editing layer will change the previous editing layer to a regular layer.

Name
Type
Description

edit

boolean

true to set as an editing layer. false to set as a regular layer.

  • Conditions for editing layer setting failure

    • In the case of a service layer (objects in service layers are dependent on tiles).

  • Sample

getMinDistance(), setMinDistance(distance) → number

Sets the visibility range of the layer.

Sets the minimum visibility distance of the layer.

Only available for user layers.

Name
Type
Description

distance

number

Minimum visibility distance of the layer (in meters).

  • Conditions for minimum visibility range setting failure.

    • If the minimum visibility range is greater than the maximum visibility range.

    • In the case of a service layer.

  • Sample

getMaxDistance(), setMaxDistance(distance) → number

Sets the visibility range of the layer.

Sets the maximum visibility distance of the layer.

Only available for user layers.

Name
Type
Description

distance

number

Maximum visibility distance of the layer (in meters).

  • Conditions for maximum visibility range setting failure.

    • If the maximum visibility range is less than the minimum visibility range.

    • In the case of a service layer.

  • Sample

getMaxLevel(), setMaxLevel(level) → number

Sets the maximum visibility level of the layer.

Only available for service layers.

Name
Type
Description

level

number

Maximum visibility level of the layer.

  • Conditions for maximum visibility level setting failure.

    • In the case of a user layer.

getName(), setName(name) → string

Sets the name of the layer.

Name
Type
Description

name

string

New name for the layer.

getObjectHorizontal(), setObjectHorizontal(horizontal) → number

Sets the size of box objects in the layer.

Sets the real-time size for parabolic animation.

Sets the horizontal size of box objects.

Name
Type
Description

horizontal

number

Horizontal size setting for box objects.

getObjectVertical(), setObjectVertical(vertical) → number

Sets the size of box objects in the layer.

Sets the real-time size for parabolic animation.

Sets the vertical size of box objects.

Name
Type
Description

vertical

number

Vertical size setting for box objects.

getSelectable(), setSelectable(type) → boolean

Sets the selection setting for the layer.

Sets the object selection event for the layer.

Available for both user and service layers.

Name
Type
Description

type

boolean

true for enabling selection events. false for disabling selection events.

getTimeSeriesCount(), setTimeSeriesCount(step) → number

Sets the animation step for box objects in the layer.

Name
Type
Description

step

number

Animation Step setting.

  • Conditions for animation step setting failure.

    • If a value less than the minimum step entered is input.

    • If a value greater than the maximum step entered is input.

    • If objects were not created with the createTimeSeriesObject() API.

  • Sample

getTimeSpeed(), setTimeSpeed(speed) → number

Sets the speed of height change for objects during animation step transition.

Name
Type
Description

speed

number

Animation transition speed setting.

  • Conditions for animation step setting failure.

    • If a value less than the minimum step entered is input.

    • If a value greater than the maximum step entered is input.

    • If objects were not created with the createTimeSeriesObject() API.

getViewLimit(), setViewLimit(tilt) → number

Sets the tilt limitation for layer visibility.

Sets objects to a transparent state if the camera tilt is less than the input value.

Limitation setting for CSV, billboard, POI, and building objects.

Only available for service layers.

Name
Type
Description

tilt

number

Sets object visibility based on camera angle.

getVisible(), setVisible(type) → boolean

Returns the visibility option information of the layer.

Returns the information on whether the layer is transparent/semi-transparent.

Available for both user and service layers.

Name
Type
Description

type

boolean

true for layer visibility. false for hiding the layer.

getWMSRequestParam(), setWMSRequestParam(parameter) → string

  • Alternative API: setWMSProvider

getWMSVersion(), setWMSVersion(version) → string

  • Alternative API: setWMSProvider

getUnion(), setUnion(union) → boolean

  • Not used

Type Definitions

WMSOptions

Basic creation options for a WMS layer.

Name
Type
Attributes
Default
Description

url

string

Request GeoServer URL.

layer

string

Request GeoServer layer name.

minimumLevel

number

optional

0

Minimum visibility level.

maximumLevel

number

optional

15

Maximum visibility level.

tileSize

number

optional

256

Requested square image size.

crs

string

optional

EPSG:4326

Coordinate type.

parameters

optional

Style, option setting property information.

WMSOptions.SubOptions

Additional creation options for a WMS layer.

Other options are added to the parameters structure and automatically included in the URL.

e.g., style option, etc.

Name
Type
Attributes
Default
Description

version

string

optional

1.1.0

GeoServer request version.

service

string

optional

WMS

GeoServer request type.

request

string

optional

GetMap

GeoServer map request type.

format

string

optional

image/png

GeoServer image request type.

transparent

string

optional

TRUE

Transparency option for image request.

Last updated