StoryMapJS API
    Preparing search index...

    Interface StoryMapMarker

    A map marker as returned by storymap.getMarker(n) / getMarkers() — the handle for openPopup() / closePopup() / popupOpen.

    interface StoryMapMarker {
        _audio_badge: boolean;
        _custom_icon: false | IconSpec;
        _custom_icon_url: string;
        _custom_image_icon: string | false;
        _el: Record<string, HTMLElement>;
        _icon: false | IconSpec | HTMLDivElement;
        _is_active: boolean;
        _marker: HTMLDivElement;
        _marker_label: string;
        _onMarkerClickBound: ((e: Event) => void) | null;
        _onMarkerKeyBound: ((e: KeyboardEvent) => void) | null;
        _onPopupKeyBound: ((e: KeyboardEvent) => void) | null;
        _overlay: Overlay;
        _popup_el: HTMLElement | null;
        _popup_enabled: boolean;
        animator: AnimationHandle | null;
        data: MapMarkerData;
        fire: <K extends "markerclick" | "popupopen" | "popupclose">(
            type: K,
            data?: MapMarkerEvents[K],
        ) => this & <K extends "markerclick" | "popupopen" | "popupclose">(
            type: K,
            data?: MapMarkerEvents[K],
        ) => this;
        marker_number: number;
        media_icon_class: string;
        options: StorymapOptions;
        timer: Timeout | null;
        get popupOpen(): boolean;
        _active(a: boolean): void;
        _addTo(m: OlMap): void;
        _closePopup(): void;
        _createMarker(d?: MapMarkerData, o?: StorymapOptions): void;
        _createMarkerElement(d: MapMarkerData, o?: StorymapOptions): HTMLDivElement;
        _createPopupElement(): HTMLElement | null;
        _customIconAnchor(size?: number[]): number[];
        _initLayout(): void;
        _location(): LatLngLiteral | null;
        _onMarkerClick(e?: unknown): void;
        _presentation(d?: MapMarkerData): MarkerPresentation;
        _removeFrom(m: OlMap): void;
        _togglePopup(): void;
        _updateAudioBadge(): void;
        _updateDisplay(width: number, height: number, animate?: boolean): void;
        active(a: boolean): void;
        addTo(m: unknown): void;
        closePopup(): void;
        createMarker(d?: MapMarkerData, o?: StorymapOptions): void;
        createPopup(_d?: MapMarkerData, _o?: StorymapOptions): void;
        dispose(): void;
        hasEventListeners<K extends "markerclick" | "popupopen" | "popupclose">(
            type: K,
        ): boolean;
        hide(): void;
        isPopupEnabled(): boolean;
        latLon(): LatLngLiteral | null;
        location(): LatLngLiteral | null;
        off<K extends "markerclick" | "popupopen" | "popupclose">(
            type: K,
            fn: (e: FiredEvent<MapMarkerEvents, K>) => void,
            context?: unknown,
        ): this;
        on<K extends "markerclick" | "popupopen" | "popupclose">(
            type: K,
            fn: (e: FiredEvent<MapMarkerEvents, K>) => void,
            context?: unknown,
        ): this;
        openPopup(): boolean;
        removeFrom(m: unknown): void;
        show(): void;
        togglePopup(): boolean;
        updateDisplay(w: number, h: number, a?: boolean): void;
    }

    Hierarchy

    • default
      • StoryMapMarker
    Index
    _audio_badge: boolean

    marker.audioBadge: flag a slide that has narration or audio media.

    _custom_icon: false | IconSpec
    _custom_icon_url: string
    _custom_image_icon: string | false
    _el: Record<string, HTMLElement>
    _icon: false | IconSpec | HTMLDivElement
    _is_active: boolean

    Mirrors active(), as a flag rather than a method reference.

    _marker: HTMLDivElement
    _marker_label: string

    Base accessible name (slide headline or label), without audio suffix.

    _onMarkerClickBound: ((e: Event) => void) | null
    _onMarkerKeyBound: ((e: KeyboardEvent) => void) | null

    Enter/Space activation for keyboard visitors, detached in dispose().

    _onPopupKeyBound: ((e: KeyboardEvent) => void) | null

    Escape-to-close, detached in dispose().

    _overlay: Overlay
    _popup_el: HTMLElement | null

    The popup card while it is open. declare fields are undefined until assigned, so every read below is a truthiness check, never === null, and there is no constructor to initialise them: MapMarker's own constructor already runs _initLayout() → _createMarker(), which assigns the flags, and initialising afterwards would wipe them.

    _popup_enabled: boolean

    marker.popup: the active marker opens its card when clicked.

    animator: AnimationHandle | null
    data: MapMarkerData
    fire: <K extends "markerclick" | "popupopen" | "popupclose">(
        type: K,
        data?: MapMarkerEvents[K],
    ) => this & <K extends "markerclick" | "popupopen" | "popupclose">(
        type: K,
        data?: MapMarkerEvents[K],
    ) => this
    marker_number: number
    media_icon_class: string
    timer: Timeout | null
    • Headline, a sanitized excerpt, the media thumb and an audio control. Every piece of text goes through sanitizeSlideText — a slide's text is untrusted input and a marker card is no different (the stored-XSS audit made that lesson once; a label is attacker-controlled text like any other).

      Returns HTMLElement | null

    • The marker's coordinate, or null when it has none (an overview slide, or a slide carrying only an image region). Every caller treats null as "nothing to focus", so this is the honest shape — the previous { lat: 0, lng: 0 } was a real point at Null Island, spelled with a longitude key nothing in the map read.

      Returns LatLngLiteral | null

    • Parameters

      • Optionale: unknown

      Returns void

    • The merged marker presentation: marker.* wins, location.* is the legacy spelling and still works. location also stays the carrier of geography, so lat/lon are read from it alone — presentation never moves a marker.

      Parameters

      • Optionald: MapMarkerData

      Returns MarkerPresentation

    • Toggle the popup card for the active marker. Inactive markers keep their original behaviour — a click navigates — so a popup never swallows navigation on a map full of pins.

      The card is a DOM element parented to the marker element and positioned with CSS, which is how it survives a move to the vector renderer (docs/plans/issue-159-vector-markers.md): only the anchor is the marker's, and that is latLon().

      Returns void

    • A small indicator on markers whose slide has narration or audio media (the Micrio affordance). Recomputed on activation, because a slide's media may only be known once it is resolved.

      Returns void

    • Parameters

      • width: number
      • height: number
      • Optionalanimate: boolean

      Returns void

    • Parameters

      • a: boolean

      Returns void

    • Parameters

      • m: unknown

      Returns void

    • Parameters

      Returns void

      Never implemented, in the original viewer either: the base MapMarker._createPopup had an empty body and the Leaflet override's body was commented out, so the map_popup option that called it never had any effect. Kept as a no-op so pre-0.10 code that calls it keeps working. Render the slide text yourself, or use CSS on .vco-mapmarker to show a label.

    • Type Parameters

      • K extends "markerclick" | "popupopen" | "popupclose"

      Parameters

      • type: K

      Returns boolean

    • Returns void

      See show — no-op since 0.9.x upstream.

    • The marker's {lat, lon}, or null when it is a non-georeferenced marker (an overview slide, or a slide with only an image region). _createMarker already established this for a real marker, but returning it from one place means the type checker can see it too.

      Returns LatLngLiteral | null

    • Type Parameters

      • K extends "markerclick" | "popupopen" | "popupclose"

      Parameters

      Returns this

    • Type Parameters

      • K extends "markerclick" | "popupopen" | "popupclose"

      Parameters

      Returns this

    • Open the popup card for this marker.

      Returns false (and opens nothing) when popups are disabled for the marker or it is not a real map marker — e.g. an overview slide. A click on an inactive marker navigates instead of opening (see the click handler in _createMarker); programmatic callers that want the card on another stop should navigate first (StoryMap.openMarkerPopup does exactly that). Fires popupopen on success.

      Returns boolean

    • Parameters

      • m: unknown

      Returns void

    • Returns void

      No-op since 0.9.x upstream (the original marker defined an empty body too). Markers are never individually hidden; use CSS on .vco-mapmarker, or active(false) to dim one.

    • Parameters

      • w: number
      • h: number
      • Optionala: boolean

      Returns void