GeoServer JavaScript API Documentation

The scripting extension includes a geoserver/catalog module that allows scripts to access resources in the GeoServer catalog.

The catalog module

var catalog = require("geoserver/catalog");

Properties

namespaces

Array A list of namespace objects. Namespaces have alias and uri properties.

catalog.namespaces.forEach(function(namespace) {
  // do something with namespace.alias or namespace.uri
});

Methods

getVectorLayer(id)
Parameters:idString The fully qualified feature type identifier (e.g. “topp:states”)
Returns:geoscript.layer.Layer

Access a feature type in the catalog as a GeoScript Layer.

var states = catalog.getVectorLayer("topp:states");