Geoportal Extension for OpenLayers
API Reference

Class: Catalog

ol.control.Catalog

Catalog Data

new Catalog(options)

Controls/Catalog/Catalog.js, line 95
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

getContainer(){DOMElement}

Controls/Catalog/Catalog.js, line 278

Get container

setMap(map)

Controls/Catalog/Catalog.js, line 222

Overwrite OpenLayers setMap method

Name Type Description
map ol.Map

Map.