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:
- Source:
Fetch the metadata for the named geoserver. When `geoserverName` is
omitted, the Context's configured geoserver is used.