Marker Class

A Marker is a CanvasDecoration, whose position follows a fixed location in world space. Markers draw on top of all scene graphics, and show visual cues about locations of interest.

see Markers

extensions

Implements

Methods

Name Description
constructor(worldLocation: Readonly<WritableXYAndZ>, size: Readonly<WritableXAndY>): Marker Constructor for Marker  
addDecoration(context: DecorateContext): void Set the position and add this Marker to the supplied DecorateContext, if it's visible.  
addMarker(context: DecorateContext): void Add this Marker to the supplied DecorateContext.  
drawDecoration(ctx: CanvasRenderingContext2D): void Called during frame rendering to display this Marker onto the supplied context.  
drawFunc(ctx: CanvasRenderingContext2D): void Optional Implement this function to draw onto the CanvasRenderingContext2D when this Marker is displayed.  
drawHilited(ctx: CanvasRenderingContext2D): boolean Protected When a Marker is displayed in its hilited state, this method is called first.  
onMouseButton(_ev: BeButtonEvent): boolean Optional Called when a mouse button is pressed over this Marker.  
onMouseEnter(ev: BeButtonEvent): void Called when the mouse pointer enters this Marker.  
onMouseLeave(): void Called when the mouse pointer leaves this Marker.  
onMouseMove(ev: BeButtonEvent): void Called when the mouse pointer moves over this Marker  
pick(pt: Readonly<WritableXAndY>): boolean Determine whether the point is within this Marker.  
positionHtml(): void Protected Position the HTMLElement for this Marker relative to the Marker's position in the view.  
setImage(image: MarkerImage | Promise<MarkerImage>): void Set the Marker.image for this marker.  
setImageUrl(url: string): void Set the image for this Marker from a URL.  
setPosition(vp: Viewport, markerSet?: MarkerSet<Marker>): boolean Set the position (in pixels) for this Marker in the supplied Viewport, based on its worldLocation.  
setScaleFactor(range: Range1dProps): void Establish a range of scale factors to increases and decrease the size of this Marker based on its distance from the camera.  
makeFrom<T extends Marker<T>>(other: Marker, ...args: any[]): T Static Make a new Marker at the same position and size as this Marker.  

Properties

Name Type Description
_hiliteColor Protected undefined | ColorDef The color for the shadowBlur when this Marker is hilited  
_isHilited Protected boolean Whether this marker is currently hilited or not.  
_scaleFactor Protected undefined | Point2d    
_scaleFactorRange Protected undefined | Range1d    
htmlElement undefined | HTMLElement An Optional (unique) HTMLElement to display with this Marker.  
image undefined | MarkerImage An image to draw for this Marker.  
imageOffset undefined | Readonly<WritableXAndY> The offset for Marker.image, in pixels, from the center of this Marker.  
imageSize undefined | Readonly<WritableXAndY> The size of Marker.image, in pixels.  
label undefined | string A text Label for this Marker.  
labelAlign undefined | MarkerTextAlign The text alignment for Marker.label.  
labelBaseline undefined | MarkerTextBaseline The text baseline for Marker.label.  
labelColor undefined | MarkerFillStyle The color for Marker.label.  
labelFont undefined | string The font for Marker.label.  
labelMaxWidth undefined | number The maximum with for Marker.label, in pixels.  
labelOffset undefined | Readonly<WritableXAndY> The offset for Marker.label, in pixels, from the center of this Marker.  
position Point3d The current position for the marker, in view coordinates (pixels).  
rect Readonly ViewRect The current rectangle for the marker, in view coordinates (pixels).  
size Point2d The size of this Marker, in pixels.  
title string | HTMLElement The title string, or HTMLElement, to show (only) in the ToolTip when the pointer is over this Marker.  
tooltipOptions undefined | ToolTipOptions The ToolTipOptions to use for Marker.title.  
visible boolean Whether this marker is currently enabled.  
wantImage Accessor ReadOnly boolean Return true to display Marker.image, if present.  
worldLocation Point3d The location of this Marker in world coordinates.  

Defined in

Last Updated: 20 June, 2023