HTMLMicrioElement state controller

The Main constructor is used as state, and offers:

  • Reading and setting the active tour and marker
  • Loading and saving the entire current state as a minimal independent JSON object

Hierarchy

  • Main

Properties

Accessors

Methods

Properties

The current MarkerTour or VideoTour store Writable

marker: Writable<Marker> = ...

The current shown image's opened Marker store Writable

popup: Writable<Marker> = ...

The current opened popup

popover: Writable<PopoverType> = ...

The current opened custom content page

ui: {
    controls: Writable<boolean>;
    zoom: Writable<boolean>;
} = ...

UI controls settings

Type declaration

  • controls: Writable<boolean>

    Show/hide main controls

  • zoom: Writable<boolean>

    Show zoom buttons if applicable

Accessors

Methods

  • Gets the current state as an independent, minimal JSON object. This includes the currently open image(s), marker(s), and actively playing media (video, audio, tour) and its state. You can use this object in any other environment to immediately replicate this state (neat!).

    Example:

    // Save the current state in Browser 1
    const state = micrio.state.get();

    // Save or sync this object to Browser 2 and load it there..

    // This makes the <micr-io> session state identical to Browser 1.
    micrio.state.set(state);

    Returns MicrioStateJSON

  • Sets the state from a MicrioStateJSON object, output by the function above here. This works on any Micrio instance!

    Parameters

    Returns Promise<void>

Generated using TypeDoc