import type { ObstructionId, SpaceId } from '../types/core.js'; import type { Feature, FeatureCollection, Point } from '../types/geojson.js'; export type TextAreaAlignment = 'near' | 'center'; /** * The area to draw text in 2/3D on the map such that it fits within some geometry. * * ASCII representations of TextAreas (without rotation): * * 1. Center alignment: * maxWidth * <------------------> * ┌──────────────────┐ ↑ * │ │ | * position---● Text │ | maxHeight * │ │ | * └──────────────────┘ ↓ * ^ * | * center * align * * 2. Near alignment (90 degree rotation, position on left): * maxWidth * <------------------> * ┌──────────────────┐ ↑ * │ │ | * position---●Text │ | maxHeight * │ │ | * └──────────────────┘ ↓ * ^ * | * near * align * * 3. Near alignment (90 degree rotation, so position on right): * maxWidth * <------------------> * ┌──────────────────┐ ↑ * │ │ | * │ Text●---position * │ │ | * └──────────────────┘ ↓ * ^ * | * near * align * * Position is the Point Feature's position. * * - maxWidth: The maximum width of the label area, in meters. * - maxHeight: The maximum height of the label area, in meters. Half the height will be above `position`, half below. * - align: How the text is aligned within the label area. Near means the text will be against the Position anchor, and center will be centered in the text area. * - rotation: The angle of rotation for the entire label (around the anchor point), in degrees clockwise from north. * * Therefore, the bounds for a TextArea with a rotation of 90 will extend maxWidth in the east direction, half the maxHeight in the north direction, * and half the maxHeight in the south direction. If it is left aligned, the text will be anchored to the west edge of the label, by the position anchor * * In addition, a TextArea can be anchored to a Space or Obstruction, or it can be floating in space. If it's anchored, it will have an `anchorId` property and be * placed on top of the geometry. If it's floating, it will have a `verticalOffset` property and be placed at a height above the ground plane. */ export type BaseTextAreaProperties = { /** * The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction. * * @exclusiveMinimum 0 */ maxWidth: number; /** * The maximum height of the label, in meters. Half the height will be above the feature's position, half below. * * @exclusiveMinimum 0 */ maxHeight: number; /** * The alignment of the text within the label. * 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated * to always be upright, so either the start or end of the text will be up against the position. * 'Center' means it will be centered in the middle of the area. */ align: TextAreaAlignment; /** * Rotation in degrees relative to north, about the position of the label. North is 0, east is 90. * * @minimum 0 * @maximum 360 */ rotation: number; }; export type AnchoredTextAreaProperties = BaseTextAreaProperties & { /** * The geometry to which this text area belongs. It will be displayed on top of it. */ anchorId: SpaceId | ObstructionId; }; export type FloatingTextAreaProperties = BaseTextAreaProperties & { /** * How high to position the text area, in meters, relative to the ground plane. * @minimum 0 */ verticalOffset: number; }; export type AnchoredTextAreaFeature = Feature; export type FloatingTextAreaFeature = Feature; export type TextAreaFeature = Feature; export type TextAreaProperties = AnchoredTextAreaProperties | FloatingTextAreaProperties; /** * A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space. */ export type TextAreaFeatureCollection = FeatureCollection; //# sourceMappingURL=textArea.d.ts.map