JSSymbol
API for managing icon objects registration.
Create a API with Module.getSymbol.
var symbol = Module.getSymbol();Function
getIcon(id) → JSIcon
Returns a JSIcon object added inside JSSymbol.
id
string
Symbol registration ID.
- Return - JSIcon: Successfully returns the icon. 
- null: Icon return failed. 
- Failure conditions. - If there is no object with the same name as - id
 
 
- Sample - Refer to the createPOI function. 
 
var icon = Module.getSymbol.getIcon("Icon_name");insertIcon(id, data, width, height) → boolean
Registers a new JSIcon inside JSSymbol.
The data variable is based on a Uint8Array of binary array data.
Input the actual size of the image for width and height (>1).
id
string
Symbol registration ID.
data
object
Image binary data.
width
number
Width of the image.
height
number
Height of the image.
- Return - true: Addition successful. 
- false: Addition failed. 
- Failure conditions - If there is an icon registration with the same id as the id. 
- If the data value is null. 
- If width, height < 0 
 
 
- Sample - Refer to the createPOI function. 
 
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
//...render image on canvas...
var data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
Module.getSymbol.insertIcon("Icon_name", data, canvas.width, canvas.height);deleteIcon(id) → boolean
Deletes a JSIcon existing inside JSSymbol.
id
string
Symbol registration ID.
- Return - true: Deletion successful. 
- false: Deletion failed. 
- Failure conditions - If an icon is not registered with the same id as that id. 
- If there is one or more objects referencing the JSIcon(Operate after deleting the texture of the referencing object). 
 
 
- Sample - Refer to the clearAnalysis function. 
 
Module.getSymbol.deleteIcon("Icon_name");Last updated
