maplibregl-recorder
    Preparing search index...

    Class RecorderControl

    The record/export panel, as a MapLibre control.

    It is the front end onto a Recorder, and the direction only goes one way: the control reaches into the engine through the same public API anyone else would use, follows its state through Recorder.onChange, and the engine knows nothing about it. Turning a recording into a page and putting that page somewhere - a file, the clipboard, a new tab, CodePen - lives here too, because it is all browser plumbing rather than recording.

    Needs dist/maplibregl-recorder.css in the page.

    map.addControl(new RecorderControl(), 'bottom-right');
    
    Index
    • Copies the reproduction page to the clipboard, ready to paste into JS Bin.

      Returns Promise<void>

    • Saves the reproduction page to disk.

      Parameters

      • filename: string = 'maplibre-repro.html'

        name of the downloaded file

      Returns this

      the control, for chaining

    • Saves the raw recording to disk, for later inspection or re-export.

      Parameters

      • filename: string = 'maplibre-recording.json'

        name of the downloaded file

      Returns this

      the control, for chaining

    • Where MapLibre puts the control when no position is given.

      Returns string

    • Builds the panel. Called by map.addControl.

      Parameters

      • Optional_map: any

        the map the control was added to

      Returns HTMLElement

      the control's element

    • Tears the panel down. Called by map.removeControl.

      Parameters

      • Optional_map: any

      Returns void

    • Opens the reproduction in CodePen, using its prefill API.

      Returns this

    • A standalone HTML page that makes the recorded calls.

      Returns string

    • Just the JavaScript of the reproduction, without the page around it.

      Returns string

    • Redraws the panel from the recorder's current state.

      Returns this