Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PopupComponent

class

PopupComponent

classdesc

Component for showing HTML popup objects.

The add method is used for adding new popups. Popups are removed by reference.

It is not possible to update popups in the set by updating any properties directly on the popup object. Popups need to be replaced by removing them and creating new ones with relevant changed properties and adding those instead.

Popups are only relevant to a single image because they are based on 2D basic image coordinates. Popups related to a certain image should be removed when the viewer is moved to another node.

To retrive and use the popup component

example
var viewer = new Mapillary.Viewer(
    "<element-id>",
    "<client-id>",
    "<my key>",
    { component: { popup: true } });

var popupComponent = viewer.getComponent("popup");

Hierarchy

  • Component<IComponentConfiguration>
    • PopupComponent

Index

Properties

Static componentName

componentName: string = "popup"

Accessors

activated

  • get activated(): boolean

defaultConfiguration

  • get defaultConfiguration(): IComponentConfiguration
  • Get default configuration.

    Returns IComponentConfiguration

    Default configuration for component.

name

  • get name(): string
  • Get name.

    description

    The name of the component. Used when interacting with the component through the Viewer's API.

    Returns string

Methods

activate

  • activate(conf?: IComponentConfiguration): void
  • Parameters

    • Optional conf: IComponentConfiguration

    Returns void

add

  • add(popups: Popup[]): void
  • Add popups to the popups set.

    description

    Adding a new popup never replaces an old one because they are stored by reference. Adding an already existing popup has no effect.

    example

    popupComponent.add([popup1, popup2]);

    Parameters

    • popups: Popup[]

      Popups to add.

    Returns void

configure

  • configure(conf: IComponentConfiguration): void
  • Parameters

    • conf: IComponentConfiguration

    Returns void

deactivate

  • deactivate(): void

fire

  • fire(eventType: string, data: any): void
  • Parameters

    • eventType: string
    • data: any

    Returns void

getAll

off

  • off(eventType: string, fn: any): void
  • Unsubscribe from an event by its name.

    Parameters

    • eventType: string

      The name of the event to subscribe to.

    • fn: any

      The handler to remove.

    Returns void

on

  • on(eventType: string, fn: any): void
  • Subscribe to an event by its name.

    Parameters

    • eventType: string

      The name of the event to subscribe to.

    • fn: any

      The handler called when the event occurs.

    Returns void

remove

  • remove(popups: Popup[]): void
  • Remove popups based on reference from the popup set.

    example

    popupComponent.remove([popup1, popup2]);

    Parameters

    • popups: Popup[]

      Popups to remove.

    Returns void

removeAll

  • removeAll(): void

Generated using TypeDoc