Constructor
new AttributionWidget(map, optionsopt)
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
map |
bemap.Map | The bemap map instance the widget attaches to. | |||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Properties
|
- Since:
- 1.5.0
- Source:
Members
(protected) _engine :String
Engine identifier: 'leaflet' | 'openlayers' | 'maplibre' | 'unknown'.
Type:
- String
(protected) customLines :Array.<(String|{text:String, href:String})>
Type:
- Array.<(String|{text:String, href:String})>
(protected) enabled :Boolean
Type:
- Boolean
(protected) map :bemap.Map
Type:
(protected) noticesLabel :String
Type:
- String
(protected) noticesUrl :String|null
Type:
- String | null
(protected) position :String
Type:
- String
(protected) showKeyboardToggle :Boolean
Off by default — the popover is for legal mentions, not UI controls.
Opt-in via `new bemap.AttributionWidget(map, { keyboardToggle: true })`.
Type:
- Boolean
Methods
destroy() → {bemap.AttributionWidget}
Detach the widget from the DOM and clean up event listeners.
Returns:
this.
getEngine() → {String}
Returns:
The detected engine identifier.
- Type
- String
getLines() → {Array.<String>}
Returns:
The current list of attribution lines that the popover would show.
- Type
- Array.<String>
hide() → {bemap.AttributionWidget}
Hide the widget (icon and popover) without destroying it.
Returns:
this.
refresh() → {bemap.AttributionWidget}
Re-compute the attribution line set and re-render the popover content.
Returns:
this.
setCustomLines(lines) → {bemap.AttributionWidget}
Replace the customer-supplied extra attribution lines.
Parameters:
| Name | Type | Description |
|---|---|---|
lines |
Array.<String> |
Returns:
this.
setPosition(corner) → {bemap.AttributionWidget}
Move the icon to a different corner of the map.
Parameters:
| Name | Type | Description |
|---|---|---|
corner |
String | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'. |
Returns:
this.
show() → {bemap.AttributionWidget}
Render the widget if it is not already attached to the DOM.
Returns:
this.