SectionMarker Class

A Marker associated with a SectionDrawingLocationState, displayed as a canvas decoration at the location of the section. Clicking on the marker toggles display of the section graphics. Mousing over the marker produces a toolbar with additional interactions.

see HyperModelingDecorator for a Decorator capable of displaying section markers for each section drawing location.

see SectionMarkerHandler to customize the marker interactions.

Extends

Methods

Name Description
constructor(state: SectionDrawingLocationState): SectionMarker Constructor, typically invoked indirectly via HyperModelingDecorator.  

Inherited methods

Name Inherited from Description
addDecoration(context: DecorateContext): void Marker Set the position and add this Marker to the supplied DecorateContext, if it's visible.
drawFunc(ctx: CanvasRenderingContext2D): void Optional Marker Implement this function to draw onto the CanvasRenderingContext2D when this Marker is displayed.
drawHilited(ctx: CanvasRenderingContext2D): boolean Protected Marker When a Marker is displayed in its hilited state, this method is called first.
onMouseLeave(): void Marker Called when the mouse pointer leaves this Marker.
onMouseMove(ev: BeButtonEvent): void Marker Called when the mouse pointer moves over this Marker
pick(pt: Readonly<WritableXAndY>): boolean Marker Determine whether the point is within this Marker.
positionHtml(): void Protected Marker Position the HTMLElement for this Marker relative to the Marker's position in the view.
setImage(image: MarkerImage | Promise<MarkerImage>): void Marker Set the image for this marker.
setImageUrl(url: string): void Marker Set the image for this Marker from a URL.
setPosition(vp: Viewport, markerSet?: MarkerSet<Marker>): boolean Marker Set the position (in pixels) for this Marker in the supplied Viewport, based on its worldLocation.
setScaleFactor(range: Range1dProps): void Marker 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 Marker Make a new Marker at the same position and size as this Marker.

Properties

Name Type Description
description Readonly string A description displayed as part of the tooltip when this marker is clustered with other markers.  
isActive Accessor ReadOnly boolean Returns true if this is the "active" section marker.  
state Readonly SectionDrawingLocationState The section drawing location state associated with the marker.  

Inherited properties

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

Defined in

Last Updated: 20 June, 2023