GeoLeaf Core API - v3.19.0
    Preparing search index...

    Map configuration section

    interface MapConfig {
        target?: string;
        id?: string;
        bounds?: [[number, number], [number, number]];
        center?: [number, number];
        zoom?: number;
        maxZoom?: number;
        minZoom?: number;
        initialMaxZoom?: number;
        padding?:
            | [number, number]
            | { top?: number; right?: number; bottom?: number; left?: number };
        positionFixed?: boolean;
        boundsMargin?: number;
        mapOptions?: Record<string, unknown>;
    }
    Index
    target?: string

    HTML element ID for the map container.

    id?: string

    Alias for target (legacy).

    bounds?: [[number, number], [number, number]]

    Geographic bounds: [[south, west], [north, east]]. Required.

    center?: [number, number]

    Initial map center [lat, lng].

    zoom?: number

    Initial zoom level.

    maxZoom?: number

    Maximum zoom level.

    minZoom?: number

    Minimum zoom level.

    initialMaxZoom?: number

    Ceiling on the zoom of the INITIAL framing: a map that starts on an extent — bounds, or the view.bounds of the start theme — never frames closer. Only a declared key caps; it caps neither the user's zoom nor a later theme switch. Also the zoom the map is created at, a moment before that framing (absent: maxZoom, then 12).

    padding?:
        | [number, number]
        | { top?: number; right?: number; bottom?: number; left?: number }

    Room in pixels kept around an extent the map frames — at start and for a theme's view.

    • An array reads [horizontal, vertical]: left and right, then top and bottom; an entry that is not a number gives 50.
    • An object gives each edge it names, and 0 to the edges it omits.

    Absent, every edge gets 50. The profile schema also admits an array of three or four numbers, but only the first two are read — this type refuses the longer forms.

    positionFixed?: boolean

    When true, restricts panning/zooming to bounds.

    boundsMargin?: number

    Degree by which bounds are padded when positionFixed is true. Default 0.3.

    mapOptions?: Record<string, unknown>

    Not read. The profile key is the ROOT mapOptions block (the profile's core features file), whose one key, preserveDrawingBuffer, the boot forwards to the engine; the profile schema refuses map.mapOptions. To pass options yourself, use mapOptions of GeoLeaf.init().