Geoportal Extension for OpenLayers
API Reference

Class: Catalog

ol.control.Catalog

Catalog Data

new Catalog(options)

Controls/Catalog/Catalog.js, line 96
Name Type Description
options Object

options for function call.

See:
  • schema : https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/doc/schema.json
  • jsdoc : https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/doc/schema.jsdoc
TODO
  • filtrage des couches
  • type:service
  • validation du schema
Fires:
  • catalog:loaded
  • catalog:layer:add
  • catalog:layer:remove
Example
var widget = new ol.control.Catalog({
          collapsed : true,
          draggable : false,
          titlePrimary : "",
          titleSecondary : "Gérer vos couches de données",
          layerLabel : "title",
          layerFilter : [],
          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", // type:"service"
              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);

Extends

  • ol.control.Control

Members

autoBoolean

specify if control add some stuff auto

categoriesArray

specify all categories

categoryIdString

specify the current category selected

collapsedBoolean

specify if control is collapsed (true) or not (false)

draggableBoolean

specify if control is draggable (true) or not (false)

eventsListenersArray

specify some events listeners

layersListObject

specify all list of layers (configuration service)

See:

layersListOnMapObject

list of layers added on map by key pair : name/service

Example
{
   "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2:WMTS" : ol/layer/Tile,
   "PLAN.IGN$GEOPORTAIL:TMS" : ol/layer/VectorTile
}

Methods

addLayerConfig(conf)

Controls/Catalog/Catalog.js, line 276

Add a layer config

Name Type Description
conf *

conf

createCatalogContentEntries(layers)

Controls/Catalog/Catalog.js, line 758

Create DOM content categories and entries

Name Type Description
layers *

couches

getContainer(){DOMElement}

Controls/Catalog/Catalog.js, line 348

Get container

getLayerId(name, service){String}

Controls/Catalog/Catalog.js, line 358

Get long layer ID

Name Type Description
name *

nom de la couche

service *

service de la couche

Returns:
layer ID

setMap(map)

Controls/Catalog/Catalog.js, line 225

Overwrite OpenLayers setMap method

Name Type Description
map ol.Map

Map.