LabelImageObject
Extends
LabelObject
Properties
isLabelImage
Used to check whether this or derived classes are label images. Default is true.
You should not change this, as it used internally by the renderer for optimisation.
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | True |
Inherited Properties
id
Type | Read-Only | Description |
---|---|---|
number | symbol | null | YES |
isAdsumObject
Used to check whether this or derived classes are Adsum object 3D. Default is true.
You should not change this, as it used internally by the renderer for optimisation.
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | True |
isLabel
Used to check whether this or derived classes are labels. Default is true.
You should not change this, as it used internally by the renderer for optimisation.
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | True |
levelOfDetails
The level of details associated to that object.
Type | Read-Only | Defaults | Description |
---|---|---|---|
LevelOfDetails | Yes | null |
Methods
getHeight
async getHeight(): Promise< number, Error>
Returns:
Type: Promise<number, Error>
getImage
async getImage(): Promise< string, Error>
Returns:
Type: Promise<string, Error>
getWidth
async getWidth(): Promise< number, Error>
Returns:
Type: Promise<number, Error>
setHeight
async setHeight(height: number): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
height | number | Yes | - |
Returns:
Type: Promise<void, Error>
setImage
async setImage(image: string | HTMLImageElement | HTMLCanvasElement ): Promise<void, Error>
WARNING: Creating Label Image is a bit special. The image source can be a data image or any valid url. As the map is rendered in a Webview, a valid url is a URL accessible from the webview.
We recommend using react-native-static-server with react-native-fs in order to support offline label creation.
Note: It is highly adviced to provide image in power of 2, i.e. both width & height are power of two. In order to make one you can add transparent area to fill up to the next power of two.
CAUTION: using too big image will affect strongly performances and might even crash on low devices.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
image | string | HTMLImageElement | HTMLCanvasElement | Yes | - |
Returns:
Type: Promise<void, Error>
setWidth
async setWidth(width: number): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
width | number | Yes | - |
Returns:
Type: Promise<void, Error>
Overwritten Methods
getType
getType(): ADSUM_OBJECT_TYPES.LabelImageObject
Returns:
Type: ADSUM_OBJECT_TYPES.LabelImageObject
Inherited Methods
getDisplayMode
async getDisplayMode(): Promise<DISPLAY_MODES.NONE|DISPLAY_MODES.VISIBLE|DISPLAY_MODES.TRANSPARENT, Error>
Returns:
Type: Promise< DISPLAY_MODES.NONE | DISPLAY_MODES.VISIBLE | DISPLAY_MODES.TRANSPARENT, Error >
getName
async getName(): Promise<string, Error>
Returns:
Type: Promise<string, Error>
getOffset
async getOffset(): Promise<{x: number, y: number, z: number},Error>
Returns:
Type: Promise<{x: number, y: number, z: number}, Error>
getOrientationMode
async getOrientationMode(): Promise<LABEL_ORIENTATION_MODES.BILLBOARD | LABEL_ORIENTATION_MODES.STATIC | LABEL_ORIENTATION_MODES.FLIP>
Returns:
Type: Promise<LABEL_ORIENTATION_MODES.BILLBOARD | LABEL_ORIENTATION_MODES.STATIC | LABEL_ORIENTATION_MODES.FLIP, Error>
getOpacity
async getOpacity(): Promise<number, Error>
Returns:
Type: Promise<number, Error>
getParent
async getParent(): Promise<SiteObject|BuildingObject|FloorObject|SpaceObject, Error>
Returns:
Type: Promise<SiteObject | BuildingObject | FloorObject | SpaceObject, Error>
getPlaceId
async getPlaceId(): Promise<number, Error>
Returns:
Type: Promise<number, Error>
getRotation
async getRotation(): Promise<number, Error>
Returns:
Type: Promise<number, Error>
getScale
async getScale(): Promise<{x: number, y: number, z: number},Error>
Returns:
Type: Promise<{x: number, y: number, z: number}, Error>
isAutoScale
async isAutoScale(): Promise<boolean, Error>
Returns:
Type: Promise<boolean, Error>
isPermanentDisplay
async isPermanentDisplay(): Promise<boolean, Error>
Returns:
Type: Promise<boolean, Error>
isSelected
async isSelected(): Promise<boolean, Error>
Returns:
Type: Promise<boolean, Error>
moveBy
async moveBy(x: number, y: number, z: number): LabelObject
Move the label by incrementing the offset position. This method will set the getOffset.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
x | number | Yes | - | |
y | number | Yes | - | |
z | number | Yes | - |
Returns:
Type: LabelObject
moveTo
async moveTo(x: number, y: number, z: number): LabelObject
Move the label to the given position. This method will set the getOffset.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
x | number | Yes | - | |
y | number | Yes | - | |
z | number | Yes | - |
Returns:
Type: LabelObject
setAutoScale
async setAutoScale(autoScale: boolean): LabelObject
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
autoScale | boolean | Yes | - |
Returns:
Type: LabelObject
setDisplayMode
async setDisplayMode(displayMode: DISPLAY_MODES.NONE|DISPLAY_MODES.VISIBLE|DISPLAY_MODES.TRANSPARENT): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
displayMode | DISPLAY_MODES.NONE | DISPLAY_MODES.VISIBLE | DISPLAY_MODES.TRANSPARENT | Yes | - |
Returns:
Type: Promise<void, Error>
setOrientationMode
async setOrientationMode(orientationMode: LABEL_ORIENTATION_MODES.BILLBOARD | LABEL_ORIENTATION_MODES.STATIC): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
orientationMode | LABEL_ORIENTATION_MODES.BILLBOARD | LABEL_ORIENTATION_MODES.STATIC | Yes | - |
Returns:
Type: Promise<void, Error>
setOpacity
async setOpacity(opacity: number): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
opacity | number | Yes | - |
Returns:
Type: Promise<void, Error>
setPermanentDisplay
async setPermanentDisplay(permanentDisplay: boolean): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
permanentDisplay | boolean | Yes | - |
Returns:
Type: Promise<void, Error>
setRotation
async setRotation(rotation: number): Promise<void, Error>
Note: rotation is only available when getOrientationMode is LABEL_ORIENTATION_MODES.STATIC
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
rotation | number | Yes | - | The rotation in degrees |
Returns:
Type: Promise<void, Error>
setScale
async setScale(x: number, y: number, z: number): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
x | number | Yes | - | |
y | number | Yes | - | |
z | number | Yes | - |
Returns:
Type: Promise<void, Error>
select
async select(): Promise<void, Error>
Mark this label as selected, this will affect the visibility behavior according to isPermanentDisplay
Returns:
Type: Promise<void, Error>
unselect
async unselect(): Promise<void, Error>
Mark this label as unselected, this will affect the visibility behavior according to isPermanentDisplay
Returns:
Type: Promise<void, Error>