Positioning Methods
Places the object on the map at the given longitude, latitude, and altitude coordinates.Parameters:
lnglat(Array): Coordinates as[lng, lat]or[lng, lat, altitude]in meters
Translates the object by the given offset coordinates.Parameters:
lnglat(Array): Translation offset as[lng, lat, altitude]
Rotation Methods
Sets the rotation of the object along the x, y, and z axes.Parameters:
xyz(Object | number): Rotation in degrees. Can be a number (applies to z-axis only) or object with{x, y, z}properties
Rotates the object on an axis instead of around its center.Parameters:
xyz(Object | number): Rotation in degrees. Can be a number (applies to z-axis) or object with{x, y, z}properties
Scale Methods
Sets the scale of the object based on units and fixedZoom settings.Parameters:
scale(number): Optional map scale value
Adjusts the object scale based on its fixedZoom property relative to map scale.Parameters:
scale(number): Optional map scale value. Usesobj.userData.mapScaleif not provided
Sets the scale and updates shadow positions.Parameters:
scale(number): Map scale value
Anchor & Positioning Methods
Sets the positional and pivotal anchor point automatically from a string parameter.Parameters:
anchor(string): Anchor position -'center','top','bottom','left','right','top-left','top-right','bottom-left','bottom-right','auto', or'none'
'bottom-left'Adjusts the center position based on size unit offsets.Parameters:
center(Object): Offset as{x, y, z}where each value represents a proportion of the object size
Calculates an adjusted position for the object accounting for model size and adjustment parameters.Parameters:
lnglat(Array): Base coordinates as[lng, lat, altitude]xyz(Object): Adjustment factors as{x, y, z}inverse(boolean): Whether to subtract (true) or add (false) the adjustment
[lng, lat, altitude]Bounding Box Methods
Creates wireframe bounding boxes for the object - one for the object itself and one projected on the ground.
Positions the shadow bounding box on the ground based on object height and rotation.
Gets the object’s bounding box in runtime.Returns:
THREE.Box3 - The object’s bounding boxAlias for
box3(). Returns the object’s bounding box.Returns: THREE.Box3Gets the size of the object’s bounding box.Returns:
THREE.Vector3 - Size as vector with x, y, z dimensionsLabel & Tooltip Methods
Adds a CSS2D label to the object.Parameters:
HTMLElement(HTMLElement | string): HTML element or string to displayvisible(boolean): Whether label is always visible. Default:falsecenter(Object): Position offset. Default:obj.anchorheight(number): Vertical position multiplier. Default:0.5
Removes the CSS2D label from the object.
Creates and attaches a CSS2D HTML label to the object.Parameters:
HTMLElement(HTMLElement | string): HTML contentvisible(boolean): Always visible flag. Default:falsecenter(Object): Position offset. Default:obj.anchorheight(number): Vertical position multiplier. Default:0.5
Adds a tooltip to the object.Parameters:
tooltipText(string): Text to display in tooltipmapboxStyle(boolean): Whether to use Mapbox styling. Default:falsecenter(Object): Position offset. Default:obj.anchorcustom(boolean): Whether tooltip is custom. Default:trueheight(number): Vertical position multiplier. Default:1
Removes the tooltip from the object.
Adds a help element to the object.Parameters:
helpText(string): Help text to displayobjName(string): Name for the CSS2D object. Default:'help'mapboxStyle(boolean): Use Mapbox styling. Default:falsecenter(Object): Position offset. Default:obj.anchorheight(number): Vertical position multiplier. Default:0
Removes the help element from the object.
Adds a CSS2D element to the object.Parameters:
element(HTMLElement): DOM element to addobjName(string): Name for the CSS2D objectcenter(Object): Position offset. Default:obj.anchorheight(number): Vertical position multiplier. Default:1
Removes a CSS2D element by name.Parameters:
objName(string): Name of the CSS2D object to remove
Shadow Methods
Positions the shadow plane on the ground based on object height and rotation.
Object Management Methods
Adds a child object to the scaleGroup.Parameters:
o(THREE.Object3D): Object to add
Removes a child object and disposes its resources.Parameters:
o(THREE.Object3D): Object to remove
Creates a clone of the object with all attributes and methods.Parameters:
options(Object): Optional configuration to override cloned object properties
Copies anchor values from another object.Parameters:
o(Object3D): Source object to copy anchors from
Disposes the object and all its resources (geometries, materials, textures).