Skip to main content

Mattertag

Types

EditableProperties

EditableProperties: object
PropertyType
descriptionstring
labelstring
media{ type: Mattertag.MediaType; src: string; }

GlobalVariableMap

GlobalVariableMap: object

Map the globals we provide in your sandbox to other names.

PropertyType
off?string | undefined
on?string | undefined
send?string | undefined
tag?string | undefined

InjectionOptions

InjectionOptions: object

Options that can be specified when injection custom HTML into a Mattertag.

PropertyType
globalVariableMap?Mattertag.GlobalVariableMap | undefined
A map for the global functions and variables we provide in your iframe sandbox. Only needs to be used if scripts you are importing also have a global send, on, off, or tag.
size?Size | undefined
The size of the frame to create
windowPath?string | undefined

MattertagData

MattertagData: object
PropertyType
anchorNormalVector3
anchorPositionVector3
The world space position of the mattertag anchor within the model
colorColor
descriptionstring
enabledboolean
floorIdnumber
floorIndexnumber
floorInfo{ id: string; sequence: number; }
labelstring
media{ type: Mattertag.MediaType; src: string; }
mediaSrcstring
mediaTypeMattertag.MediaType
parsedDescriptionMattertag.DescriptionChunk[]
sidstring
stemHeightnumber
stemVectorVector3
The world space (non-normal) direction of the mattertag's stem
stemVisibleboolean

ObservableMattertagData

ObservableMattertagData: object
PropertyType
anchorPositionVector3
The world space position of the mattertag anchor within the model
colorColor
descriptionstring
enabledboolean
floorIndexnumber
floorInfo{ id: string; sequence: number; }
labelstring
media{ type: Mattertag.MediaType; src: string; }
sidstring
stemVectorVector3
The world space (non-normal) direction of the mattertag's stem
stemVisibleboolean

PreventableActions

PreventableActions: object
PropertyType
navigatingboolean
openingboolean

Enumerations

DescriptionChunkType

DescriptionChunkType: enum
MemberValue
LINK"tag.chunk.link"
NONE"tag.chunk.none"
TEXT"tag.chunk.text"

Event

Event: enum
MemberValue
CLICK"tag.click"
HOVER"tag.hover"
LINK_OPEN"tag.linkopen"

LinkType

LinkType: enum
MemberValue
EXT_LINK"tag.link.ext"
An external link
MODEL"tag.link.model"
A link to a different Matterport model
NAVIGATION"tag.link.nav"
A link to another position in the current model

MediaType

MediaType: enum
MemberValue
NONE"mattertag.media.none"
PHOTO"mattertag.media.photo"
RICH"mattertag.media.rich"
VIDEO"mattertag.media.video"

TransitionType

TransitionType: enum

Transition types for camera movements. This is the canonical transition type enum. Used for Mode.moveTo, Sweep.moveTo, Mattertag.navigateToTag, and other camera movement methods. Note: not all values are supported, refer to per-method documentation for details.

See Camera.TransitionType

MemberValue
FADEOUT"transition.fade"
Fade to black transition
FLY"transition.fly"
Fly transition
INSTANT"transition.instant"
Instant transition
MOVEFADE"transition.movefade"
experimental Move with fade transition
ORBIT"transition.orbit"
experimental Orbit transition

Observables

data

deprecated Use Tag.data instead

An observable collection of Mattertag data that can be subscribed to.

Methods

add

add(newTagData: Mattertag.MattertagDescriptor | Mattertag.MattertagDescriptor[]): Promise<string[]>
deprecated Use Tag.add instead

Add one or more Mattertags to Showcase. Each input Mattertag supports setting the label, description, color, anchorPosition, and stemVector.

Two properties are required:

  • anchorPosition, the point where the tag connects to the model
  • stemVector, the direction, aka normal, and height that the Mattertag stem points

See Pointer.intersection for a way to retrive a new anchorPosition and stemVector.

Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.

ParameterType
newTagDataMattertag.MattertagDescriptor | Mattertag.MattertagDescriptor[]
A single or array of Mattertag templates to add.

Returns: Promise<string[]>

A promise that resolves with the sids for the newly added Mattertags.

editBillboard

editBillboard(tagSid: string, properties: Partial<Mattertag.EditableProperties>): Promise<void>
deprecated Use Tag.editBillboard or Tag.registerAttachment and/or Tag.attach to manage media

Edit the data in a Mattertag billboard.

Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.

ParameterType
tagSidstring
the sid of the Mattertag to edit
propertiesPartial<Mattertag.EditableProperties>
A dictionary of properties to set

Returns: Promise<void>

editColor

editColor(tagSid: string, color: Color): Promise<void>
deprecated Use Tag.editColor instead

Edit the color of a Mattertag

ParameterType
tagSidstring
The sid of the Mattertag to edit
colorColor
The new color to be applied to the Mattertag disc

Returns: Promise<void>

editIcon

editIcon(tagSid: string, iconId: string): Promise<void>
deprecated Use Tag.editIcon instead

Change the icon of the Mattertag disc

Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.

ParameterType
tagSidstring
The sid of the Mattertag to edit
iconIdstring
The id of the icon to apply

Returns: Promise<void>

Errors Warns if the provided iconSrc is an .svg file which doesn't have a 'width' or 'height' attribute. Defaults to a resolution of 128x128 if neither exist.

editOpacity

editOpacity(tagSid: string, opacity: number): Promise<void>
deprecated Use Tag.editOpacity instead

Edit the opacity of a Mattertag

ParameterType
tagSidstring
The sid of the Mattertag to edit
opacitynumber
The target opacity for the Mattertag in the range of [0, 1]

Returns: Promise<void>

editPosition

editPosition(tagSid: string, moveOptions: Partial<Mattertag.PositionOptions>): Promise<void>
deprecated Use Tag.editPosition instead

Move and reorient a Mattertag.

See Pointer.intersection for a way to retrieve a new anchorPosition and stemVector.

Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.

ParameterType
tagSidstring
The sid of the Mattertag to reposition
moveOptionsPartial<Mattertag.PositionOptions>
The new anchorPosition, stemVector and/or floorId.

Returns: Promise<void>

editStem

editStem(tagSid: string, options: { stemHeight?: number; stemVisible?: boolean; }): Promise<void>
deprecated Use Tag.editStem instead
Introduced 3.1.70.10-0-ge9cb83b28c

Edit the stem of a Mattertag

ParameterType
tagSidstring
The sid of the Mattertag to edit
options{ stemHeight?: number; stemVisible?: boolean; }
What to change about the Mattertag's stem - can include stemHeight and stemVisible

Returns: Promise<void>

getData

getData(): Promise<Mattertag.MattertagData[]>
deprecated Use Tag.data instead

This function returns metadata on the collection of Mattertags.

Returns: Promise<Mattertag.MattertagData[]>

getDiscPosition

deprecated Disc position is automatially included in Tag.data

Get the disc's (3d) position of a Mattertag.

ParameterType
tagMattertag.MattertagData | Mattertag.ObservableMattertagData
result?Vector3

Returns: Vector3

injectHTML

injectHTML(tagSid: string, html: string, options: Mattertag.InjectionOptions): Promise<Mattertag.IMessenger>
deprecated Use Tag.registerSandbox and Tag.attach instead

Add a custom frame that can host custom HTML and JavaScript, and communicate bi-directionally with your page.

The frame that contains your custom code will have certain limitations due to being sandboxed by the sandbox='allow-scripts attribute. Attempting to access properties of other windows will also be blocked by the browser. (see the MDN pages about iframe sandbox)

Currently, the HTML CAN ONLY BE SET ONCE by a call to injectHTML. This includes removing or clearing the HTML.

ParameterType
tagSidstring
htmlstring
optionsMattertag.InjectionOptions

Returns: Promise<Mattertag.IMessenger>

navigateToTag(tagSid: string, transition: Mattertag.Transition, force?: boolean): Promise<string>

This function navigates to the Mattertag disc with the provided sid, opening the billboard on arrival.

mpSdk.Mattertag.navigateToTag(sid, mpSdk.Camera.Transition.FLY);
ParameterType
tagSidstring
The sid of the Mattertag to navigate to
transitionMattertag.Transition
The type of transition to navigate to a sweep where the Mattertag disc is visible
force?boolean
If navigating to the tag is disabled, passing force === true will force the transition to occur

Returns: Promise<string>

preventAction

preventAction(tagSid: string, actions: Partial<Mattertag.PreventableActions>): Promise<void>
deprecated Use Tag.allowAction instead

Prevents the "default" Showcase action on a Mattertag from occurring: hover to open billboard, click to navigate to view.

ParameterType
tagSidstring
The sid of the Mattertag to remove actions from
actionsPartial<Mattertag.PreventableActions>
The set of actions to prevent

Returns: Promise<void>

registerIcon

registerIcon(iconId: string, iconSrc: string): Promise<void>
deprecated Use Asset.registerTexture instead

Register an icon to use with subsequent Mattertag.editIcon calls.

Note: It is recommended to host your own images to mitigate cross origin limitations.

ParameterType
iconIdstring
A user specified string to use as a lookup of this icon
iconSrcstring
The src of the icon, like the src of an <img>

Returns: Promise<void>

remove

remove(tagSids: string | string[]): Promise<string[]>
deprecated Use Tag.remove instead

Removes one or more Mattertags from Showcase.

Note: these changes are not persisted between refreshes of Showcase. They are only valid for the current browser session.

ParameterType
tagSidsstring | string[]
A single Mattertag sid or array of Mattertag sids to remove.

Returns: Promise<string[]>

A promise with an array of Mattertag sids that were actually removed.

resetIcon

resetIcon(tagSid: string): Promise<void>
deprecated Use Tag.resetIcon instead

Resets the icon of the Mattertag disc back to its original icon.

ParameterType
tagSidstring
The sid of the Mattertag to reset

Returns: Promise<void>