The module exports the link_button plugin method to mapp.plugins{}

Methods

(inner) addButton(link, localeKey)

The addButton method creates a link element and appends the element to the mapButton.

Parameters:
NameTypeDescription
linkObject

The link object.

localeKeystring

The key of the current mapview locale.

Properties
NameTypeAttributesDescription
link.hrefstring

The link URL.

link.titlestring

The link title, defaults to "Link".

link.targetstring

The link target, defaults to "_blank".

link.css_classstring

The class for the div, defaults to "mask-icon".

link.css_stylestring

The style for the div.

link.localeboolean<optional>

Whether to append the locale to the href.

The link_button locale property is provided as the link_button function argument. This can be either a single object or an array of objects.

"link_button": [
  {
    "href": "/url/url",
    "title": "TITLE HERE",
    "css_style": "mask-image: url(https://geolytix.github.io/MapIcons/services/component_exchange.svg); -webkit-mask-image: url(https://geolytix.github.io/MapIcons/services/component_exchange.svg);"
  },
  {
    "href": "/foo",
    "title": "Foo",
    "locale": true
  }
]

The link_button method will call the addButton method for each link_button object.

Parameters:
NameTypeDescription
link_buttonObject

The link_button config, can be an array of objects.

mapviewmapview

The mapview object.