var widget = new ol.control.Catalog({
collapsed : true,
draggable : false,
titlePrimary : "",
titleSecondary : "Gérer vos couches de données",
layerLabel : "title",
search : {
display : true,
criteria : [
"name",
"title",
"description"
]
},
addToMap : true,
categories : [
{
title : "Données",
id : "data",
default : true,
filter : null
// sous categories
// items : [
// {
// title : "",
// default : true,
// filter : {
// field : "",
// value : ""
// }
// }
// ]
}
],
configuration : {
type : "json",
urls : [ // data:{}
"https://raw.githubusercontent.com/IGNF/cartes.gouv.fr-entree-carto/main/public/data/layers.json",
"https://raw.githubusercontent.com/IGNF/cartes.gouv.fr-entree-carto/main/public/data/edito.json"
]
}
});
widget.on("catalog:loaded", (e) => { console.log(e.data); });
widget.on("catalog:layer:add", (e) => { console.log(e); });
widget.on("catalog:layer:remove", (e) => { console.log(e); });
map.addControl(widget);
specify if control add some stuff auto
specify all categories
specify the current category selected
specify if control is collapsed (true) or not (false)
Protected
disposedThe object has already been disposed.
specify if control is draggable (true) or not (false)
specify some events listeners
specify all list of layers (configuration service)
list of layers added on map by key pair : name/service
Protected
listenerKey name.
Listener.
Type.
Listener.
Add a layer config
conf
Protected
applyProtected
Apply any properties from another object without triggering events.
The source object.
Create DOM content categories and entries
couches
Dispatches an event and calls all listeners listening for events
of this type. The event parameter can either be a string or an
Object with a type
property.
Event object.
false
if anyone called preventDefault on the
event object or if any of the listeners returned false.
Clean up.
Protected
disposeProtected
Extension point for disposable objects.
Get container
container
Get long layer ID
nom de la couche
service de la couche
Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.
Type.
Listeners.
Get an object of all property names and values.
Object.
Optional
type: stringType. If not provided,
true
will be returned if this event target has any listeners.
Has listeners.
The object has properties.
Key name.
Old value.
Protected
onceProtected
onKey name.
Listener.
Type.
Listener.
Overwrite OpenLayers setMap method
Map.
This function is used to set a target element for the control. It has no
effect if it is called after the control has been added to the map (i.e.
after setMap
is called on the control). If no target
is set in the
options passed to the control constructor and if setTarget
is not called
then the control is added to the map's overlay container.
Target.
Protected
unProtected
Unlisten for a certain type of event.
Type.
Listener.
event triggered when layer is added
catalog:layer:add
event triggered when data is loaded
catalog:loaded
event triggered when layer is removed
catalog:layer:remove
options for function call.