Class: AttributionWidget

bemap.AttributionWidget(map, optionsopt)

AttributionWidget — cross-engine map credits and legal mentions panel. Customers don't usually instantiate this directly; it is created automatically by each map constructor when `options.attribution` is omitted or set to a truthy value. Power users who want a fully customised setup can construct it explicitly. **Position above a bottom overlay (CSS).** When the host app has a bar or panel over the bottom of the map (timeline, drawer, toolbar), set the CSS custom property `--bemap-attribution-bottom-offset` on the map container — or any ancestor — to lift the widget by that many pixels; no JavaScript required. It defaults to `0px` (other apps are unaffected), applies to the `bottom-*` positions only, and shifts both the ⓘ icon and its popover. Example: `#map { --bemap-attribution-bottom-offset: 70px; }`

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
Name Type Attributes Default Description
position String <optional>
'bottom-right' One of 'top-left' / 'top-right' / 'bottom-left' / 'bottom-right'.
customLines Array.<(String|{text:String, href:String})> <optional>
Extra attribution lines (brand mention, overlay data licence, etc.). Each entry may be a plain string or a `{ text, href }` object.
noticesUrl String <optional>
URL to the full open-source notices document (typically `OPEN_SOURCE_NOTICES.md` or `.txt`). When set, the popover shows a "Open source notices" footer link that opens the URL in a new tab.
noticesLabel String <optional>
'Open source notices' Label of the notices footer link.
enabled Boolean <optional>
true When false, the widget is constructed but not rendered.
Since:
  • 1.5.0
Source:

Members

(protected) _engine :String

Engine identifier: 'leaflet' | 'openlayers' | 'maplibre' | 'unknown'.
Type:
  • String
Source:

(protected) customLines :Array.<(String|{text:String, href:String})>

Type:
  • Array.<(String|{text:String, href:String})>
Source:

(protected) enabled :Boolean

Type:
  • Boolean
Source:

(protected) map :bemap.Map

Type:
Source:

(protected) noticesLabel :String

Type:
  • String
Source:

(protected) noticesUrl :String|null

Type:
  • String | null
Source:

(protected) position :String

Type:
  • String
Source:

(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
Source:

Methods

destroy() → {bemap.AttributionWidget}

Detach the widget from the DOM and clean up event listeners.
Source:
Returns:
this.
Type
bemap.AttributionWidget

getEngine() → {String}

Source:
Returns:
The detected engine identifier.
Type
String

getLines() → {Array.<String>}

Source:
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.
Source:
Returns:
this.
Type
bemap.AttributionWidget

refresh() → {bemap.AttributionWidget}

Re-compute the attribution line set and re-render the popover content.
Source:
Returns:
this.
Type
bemap.AttributionWidget

setCustomLines(lines) → {bemap.AttributionWidget}

Replace the customer-supplied extra attribution lines.
Parameters:
Name Type Description
lines Array.<String>
Source:
Returns:
this.
Type
bemap.AttributionWidget

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'.
Source:
Returns:
this.
Type
bemap.AttributionWidget

show() → {bemap.AttributionWidget}

Render the widget if it is not already attached to the DOM.
Source:
Returns:
this.
Type
bemap.AttributionWidget