Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SideCard

A SideCard helps adding information to the map. Extends this class to make a custom one. SideCard has support for actions and values.

const mapsterSideCard = new Mapster.SideCard({
    subtitle: 'hace 5 min.',
    values: [
        {
            label: 'ID',
            value: '959483',
        },
        {
            label: 'BaterĂ­a',
            value: '12.5 V',
        },
    ],
})

// Add SideCard to map
map.setSideCard(mapsterSideCard);

Table Result

You can also add actions and title to your SideCard like such:

Support for custom icons is still in my TODO list!
We currently only support the following icons:
- icon-info
- icon-circle
- icon-square
- icon-clear
- icon-linegraph
- icon-info2
- icon-gps_not_fixed
- icon-gps_fixe

const mapsterSideCard = new Mapster.SideCard({
    subtitle: 'hace 5 min.',
    title: 'title',
    values: [
        {
            label: 'ID',
            value: '959483',
        },
        {
            label: 'BaterĂ­a',
            value: '12.5 V',
        },
    ],
    actions: [{
        icon: "icon-clear",
        label: "hey",
    }]
})

// Add SideCard to map
baseMap.setSideCard(mapsterSideCard);

Table Result

Hierarchy

  • SideCard

Index

Constructors

Properties

Accessors

Constructors

constructor

  • Creates a new SideCard instance.

    Parameters

    Returns SideCard

Properties

Protected Optional _container

_container: HTMLElement

Accessors

actions

  • Change SideCard's actions

    Parameters

    Returns void

element

  • get element(): HTMLElement
  • HTMLElement

    Returns HTMLElement

loading

  • set loading(loading: boolean): void
  • Change from loading to loaded and viceversa

    Parameters

    • loading: boolean

    Returns void

Generated using TypeDoc