Image content data

The image content ImageData JSON object, which is accessible as MicrioImage.data as the SvelteStore.Writable store, and MicrioImage.$data for its current value.

This JSON data includes, for all published languages for this image:

  • Markers
  • Marker tours
  • Video tours
  • Audio, music
  • In-image embeds
  • Custom menu screens and content pages

To access the data of the current viewed image, use:

// The current shown image value of the .data store Writable
const data = micrio.$current.$data;

if(data) console.log(`The current image has ${data.markers.length} markers!`);
else console.warn('The current image has no data set.');

To subscribe to any data changes:

micrio.$current.data.subscribe(data => {
console.log('Image has new or updated data!', data);
})

To set your own custom data:

micrio.$current.data.set({
"markers": [
{
"i18n": {
"en": {
"title": "This is a test marker!"
}
},
"x": .5,
"y": .5
}
]
})

Or to update an existing loaded data object:

micrio.$current.data.update(data => {
data.markers.push({
"i18n": {
"en": {
"title": "This is a newly added marker"
}
},
"x": .6,
"y": .5
});
return data;
})

Index

Interfaces

Type Aliases