Class: GeoServerInfoService

bemap.GeoServerInfoService(context, optionsopt)

new GeoServerInfoService(context, optionsopt)

BeNomad BeMap JavaScript API - GeoServerInfoService (v1.5) Promise-based wrapper around `POST service/geoServerInfo/1.0`. Returns the metadata for a given geoserver: which BeMap services it exposes (Routing, Geocoding, NearPoi, ...), which travel modes it supports, the global copyright + supplier terms strings, and the per-service resource limits (max distance, max via count, max isochrone radius, ...). **Why you want this in a customer app.** Combined with `bemap.AclService.getCurrentUserDetails()` (which tells you _which geoservers_ the user is allowed to use), this service tells you _which services_ each of those geoservers actually exposes — so the UI can disable controls that wouldn't work, surface server-side limits as form hints, and never send a request the server would reject. Typical use: var info = new bemap.GeoServerInfoService(ctx); info.getInfo('here').then(function(meta) { if (!meta.hasService('NearPoi')) hideNearPoiButton(); var maxDist = meta.getLimitsForService('BenomadNearPoiService') .find(function(l) { return l.getKey() === 'MaxDistance'; }); if (maxDist) updateSliderMax(Number(maxDist.getValue())); });
Parameters:
Name Type Attributes Description
context bemap.Context BeMap-JS-API Context. Mandatory.
options Object <optional>
Since:
  • 1.5.0
Source:

Extends

  • bemap.ServiceV2

Methods

getInfo(geoserverNameopt, optionsopt) → {Promise.<bemap.GeoServerInfoResponse>}

Fetch the metadata for the named geoserver. When `geoserverName` is omitted, the Context's configured geoserver is used.
Parameters:
Name Type Attributes Description
geoserverName String <optional>
options Object <optional>
Properties
Name Type Attributes Description
language String <optional>
ISO 639-1 language code for titles / descriptions.
options Array.<String> <optional>
Optional list of `LayersInfoOption` values.
signal AbortSignal <optional>
Source:
Returns:
Type
Promise.<bemap.GeoServerInfoResponse>