Tip: After you access the tileset object, the following methods and properties are applicable on the tileset.
Properties:
uuid
Returns the universally unique identifier (UUID) of the tileset.
Returns:
uuid: Returns uuid string.
Example:
const tilesetUuid = tileset.uuid;
name
Returns the name of the tileset.
Returns:
String: Returns tileset name.
Example:
const tilesetName = tileset.name;
display_name
Returns the display name of the tileset.
Returns:
String: Returns display name of tileset.
Example:
const tilesetDisplayName = tileset.display_name;
description
Returns the description of the tileset.
Returns:
String: Returns tileset description.
Example:
const tilesetDescription = tileset.description;
created_at
Returns the time and date that the tileset was created.
Returns:
Date: Returns tileset created time.
Example:
const tilesetCreatedTime = tileset.created_at;
last_modified_at
Returns the time and date that the tileset attribute is updated.
Returns:
Date: Returns tileset updated time.
Example:
const tilesetModifiedTime = tileset.last_modified_at;
last_updated_at
Returns the time and date that the tileset content is updated.
Returns:
Date: Returns tileset updated time.
Example:
const tilesetUpdatedTime = tileset.last_updated_at;
is_shared
Indicates whether the tileset is shared or not.
Returns:
Boolean: If true, tileset is shared.
Example:
const isShared = tileset.is_shared;
id
Returns the tileset id.
Returns:
Number: Returns tileset id.
Example:
const tilesetId = tileset.id;
owner_id
Returns the user ID that the tileset belongs to.
Returns:
Number: Returns tileset owner id.
Example:
const tilesetOwnerId = tileset.owner_id;
state
Shows the status of the tileset construction.
Returns:
String: Returns tileset state.
Example:
const tilesetState = tileset.state;
min_zoom
Returns the smallest zoom at which the tileset is displayed.
Returns:
Number: Returns tileset minimum zoom number.
Example:
const minZoom = tileset.min_zoom;
max_zoom
Returns the largest zoom at which the tileset is displayed.
Returns:
Number: Returns tileset maximum zoom number.
Example:
const maxZoom = tileset.max_zoom;
extent
Returns the coordinates of the tileset extent in the Web Mercator coordinate system.
Returns:
Array: Returns an array contains [southwest x, southwest y, northeast x, northeast y].
Example:
const tilesetExtent = tileset.extent;
Methods:
getLayers()
Returns the layers that compose the tileset.
Returns:
Array: Returns an array of layers that forming the tileset.
Example:
const tilesetLayers = tileset.getLayers();
addLayer(layer_type, layer_uuid)
Adds vector layer or vector layer view to the tileset.
Parameters:
layer_type is ‘vector’ or ‘view’.
layer_uuid is the available vector or view layer uuid.
Returns:
String: Returns a message that shows adding layer was successful or not. Null message means adding was successful.
Example:
const result = tileset.addLayer('vector','4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
removeLayer(layer_type, layer_uuid)
Removes vector layer or vector layer view from the tileset.
Parameters:
layer_type is ‘vector’ or ‘view’.
layer_uuid is the available vector or view layer uuid.
Returns:
String: Returns a message that shows removing layer was successful or not. Null message means removing was successful.
Example:
const result = tileset.removeLayer('vector','4f9f3e4b-4dc1-469b-83ab-00ae00f02581');