MapBox Legend management

ol.style.editor.Legend

options for function call.

...

...

(internal) ...

...

...

{h:, w:} ...

...

...

...

...

...

...

var legend = new Legend ({
target : ...,
position : 1, // identifiant de position (unique !)
sprites : {
url : "http://localhost/sprites.png",
size : { w : 450, h : 550 },
json : {
icon-1 : {x:,y:,height:,width:,pixelRatio:},
icon-2 : {x:,y:,height:,width:,pixelRatio:}
}
},
obj : {
title : "",
editable : true, // tag non standard issue du style json dédié à l'edition
paint : {"fill-color": "#2BB3E1"},
layout : {visibility:"none"}
}
});
legend.add();
legend.display(true);
legend.isEditable();
legend.getRenderContainer();
legend.getToolsContainer();
legend.getContainer();

Constructors

Properties

container: undefined | null | HTMLDivElement
editable: any
id: any
labels:
    | undefined
    | {
        "fill-color": string;
        "fill-opacity": string;
        "line-color": string;
        "line-opacity": string;
        "line-width": string;
    }
legendRender: any
name:
    | undefined
    | {
        container: string;
        containerlegendrender: string;
        containerlegendtools: string;
        legendeditable: string;
        legendrender: string;
        legendtitle: string;
        target: string;
    }
options: any
rendercontainer: undefined | null | HTMLDivElement
toolscontainer: undefined | null | HTMLElement
PROPERTIES: {
    background: string[];
    circle: string[];
    fill: string[];
    icon: string[];
    line: string[];
    text: string[];
}

List of supported properties

Methods

  • Get container Legend Render (DOM)

    Returns HTMLElement

    DOM element

    Layer.prototype.slotLegend()

    <div class="GPEditorMapBoxLegendRender legend-(line|fill|background|text|icon|circle|unknow)" style="..."></div>
    
  • Get container Legend Tools (DOM)

    Returns HTMLElement

    DOM element

    Layer.prototype.slotLegend()

    <div class="GPEditorMapBoxLegendToolsContainer">...</div>