Geoportal Extension for OpenLayers API Reference

Class: Layer

ol.style.editor.Layer

MapBox filter management

new Layer(options)

OpenLayers/Controls/Editor/Layer.js, line 55
Name Type Description
options Object

options for function call.

Example
var layers = new Layer ({
     target : ...,
     position : 1, // identifiant de position (unique !)
     tools : {
         "visibility" : true, // afficher l'icone de visibilité
         "icon" : {
             "image" : true, // afficher l'icone "oeil" (defaut) ou une checkbox
             "anchor" : "start" | "end"  // afficher l'icone au debut ou à la fin (defaut)
         },
         "type" : true,       // afficher l'icone du type de geometrie
         "pin" : true,        // afficher l'icone de puce
         "remove" : false,    // TODO afficher l'icone de suppression
         "clone" : false      // TODO afficher l'icone de duplication
     },
     obj : {
         "id": "ocs - vegetation", // MANDATORY
         "type": "fill", // OPTIONAL
         "source": "pyramide_proto", // OPTIONAL
         "source-layer": "ocs_vegetation_surf" // OPTIONAL
     }
  });
 layers.addLegend(oLegend);
 layers.slotLegend();
 layers.addStyle(oStyle);
 layers.addFilter(oFilter);
 layers.add();
 layers.active(false);
 layers.visibility(false);
 layers.display(false);
 layers.collapse();
 EventBus.addEventListener("editor:layer:onclickvisibility", function (e) {
    // e.target.data : options !
    // e.target.editorID : id or null
  }, this);

Methods

active(active){Boolean}

OpenLayers/Controls/Editor/Layer.js, line 533

Set disabled/enabled status or get

Name Type Description
active Boolean

disable/enable layer interaction or get status

add(){Object}

OpenLayers/Controls/Editor/Layer.js, line 371

Add element into target DOM

Returns:
instance

addFilter(filter)

OpenLayers/Controls/Editor/Layer.js, line 408

Add filter in the submenu

Name Type Description
filter Object

filter object

addLegend(legend)

OpenLayers/Controls/Editor/Layer.js, line 421

Add Legend in the submenu

Name Type Description
legend Object

legend object

addStyle(style)

OpenLayers/Controls/Editor/Layer.js, line 395

Add style in the submenu

Name Type Description
style Object

style object

collapse()

OpenLayers/Controls/Editor/Layer.js, line 487

Collapse a layer panel (event)

display(display){Boolean}

OpenLayers/Controls/Editor/Layer.js, line 509

Set collapse or get

Name Type Description
display Boolean

show/hidden container or get status

getContainer(){DOMElement}

OpenLayers/Controls/Editor/Layer.js, line 548

Get container (DOM)

Returns:
element

slotLegend()

OpenLayers/Controls/Editor/Layer.js, line 432

Integrate Legend to the layer container

visibility(display){Boolean}

OpenLayers/Controls/Editor/Layer.js, line 473

Set visibility or get

Name Type Description
display Boolean

set visibility or undefined to get status

visible()

OpenLayers/Controls/Editor/Layer.js, line 495

Click on visibility icon (event)