Skip to main content

Mattertags

Deprecated

The Mattertag namespace has been deprecated. Please use the Tags namespace instead. For migration guidance, see Migrating from Mattertags.

Creating Mattertags

The Mattertag.add function takes a single or an array of MattertagDescriptor objects. The following properties are supported by MattertagDescriptor:

PropertyRequiredDescription
anchorPositionyesThe mattertag anchor, It is typically attached to a surface on the matterport model.
stemVectoryesThe mattertag stem. It's length determines how far it will be offset from the anchor position.
colornoThe color of the disc.
descriptionnoThe mattertag description. Links can be included in the description.
labelnoThe mattertag label.
mediaTypenoThe mediaSrc type. This can be photo, video, or rich media. This property must be set to display the media source.
mediaSrcnoA url to the media. The urls must be supported by embed.ly
floorIdnoThe floor identifier associated witht the mattertag.

mattertag properties

Mattertag Properties

note

To find an anchor position, stemVector and floorId for your model, you can use the Intersection Inspector Tool

Adding a mattertag with a label and no stem

var mattertagDesc = {
label: 'Hello Mattertag',
anchorPosition: { x: 1.39, y: 2.00, z: -0.122 },
stemVector: { x: 0, y: 0, z: 0 }
};

sdk.Mattertag.add(mattertagDesc).then(function(mattertagId) {
console.log(mattertagId);
// output: TODO
});

Adding multiple mattertags at once

var mattertags = [{
label: 'Tag 1',
anchorPosition: { x: 0, y: 0, z: 0},
stemVector: { x: 0, y: 0, z: 0}
},{
label: 'Tag 2',
description: '<3 this tag!',
anchorPosition: { x: 1, y: 0, z: 0 },
stemVector: { x: 0, y: 0.5, z: 0}
}];

sdk.Mattertag.add(mattertags).then(function(mattertagIds) {
console.log(mattertagIds);
// output: TODO
});

Coordinate Conventions & SDK vs API Coordinates

Users of Model API may notice that the coordinate system in Showcase does not match API data. For an in-depth overview of the SDK Coordinate system, please visit our concepts page

Editing Mattertags

The description supports the following markdown link format:

[link text](link url)

The following code snippets produces the image below it.

sdk.Mattertag.editBillboard(mattertagSid, {
description:"[Link to Matterport site!](https://www.matterport.com)",
});

description link

Setting an image media source

We use embedly to present image media. We recommend that you verify your image url with the embedly explore display tool before setting it as a media source.

  • Select your image url. For example:
https://static.matterport.com/mp_cms/media/filer_public/71/ca/71cabc75-99a5-41a4-917c-f45203f9254e/pro-21f8ddbae.png
  • Verify your image is displayed correctly on the embedly explore display tool

embedly explore display

sdk.Mattertag.editBillboard(mattertagSid, {
media: {
type: sdk.Mattertag.MediaType.PHOTO,
src: 'https://static.matterport.com/mp_cms/media/filer_public/71/ca/71cabc75-99a5-41a4-917c-f45203f9254e/pro-21f8ddbae.png',
});

mattertag with image

Setting a video media source

We use embedly to present video media. We recommend that you verify your video url with the embedly explore embed tool before setting it as a media source.

  • Select your video url. For example:
https://www.youtube.com/watch?v=uO_x9TFNmTk
  • Verify your video is displayed correctly on the embedly explore embed tool

embedly explore embed

sdk.Mattertag.editBillboard(mattertagSid, {
media: {
type: sdk.Mattertag.MediaType.VIDEO,
src: 'https://www.youtube.com/watch?v=uO_x9TFNmTk',
});

mattertag with video