/plugins/link_button
The module exports the link_button plugin method to mapp.plugins{}
- Source
Methods
(inner) addButton(link, localeKey)
The addButton method creates a link element and appends the element to the mapButton.
Parameters:
PropertiesName | Type | Description |
---|---|---|
link | Object | The link object. |
localeKey | string | The key of the current mapview locale. |
Name | Type | Attributes | Description |
---|---|---|---|
link.href | string | The link URL. | |
link.title | string | The link title, defaults to "Link". | |
link.target | string | The link target, defaults to "_blank". | |
link.css_class | string | The class for the div, defaults to "mask-icon". | |
link.css_style | string | The style for the div. | |
link.locale | boolean | <optional> | Whether to append the locale to the href. |
- Source
(inner) link_button(link_button, mapview)
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:
Name | Type | Description |
---|---|---|
link_button | Object | The link_button config, can be an array of objects. |
mapview | mapview | The mapview object. |
- Source