Optional
opts: SHOGunApplicationUtilOptsOptional
ids: number[]Optional
projection: ProjectionLikeOptional
projection: ProjectionLikeOptional
projection: ProjectionLikeOptional
additionalOpts: ViewOptionsOptional
projection: ProjectionLikeProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsAbstract
Protected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsAbstract
Protected
constructorProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsAbstract
Protected
constructorProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsOptional
fetchOpts: RequestInitProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakOptional
fetchOpts: RequestInitProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsProtected
Readonly
baseProtected
Optional
Readonly
keycloakProtected
getOptional
pageOpts: PageOptsConnect to a SHOGun instance with ease.
+npm i @terrestris/shogun-util
+
+
+This package contains two core classes:
+SHOGunAPIClient
: Provides access to the HTTP API endpoints of SHOGun.SHOGunApplicationUtil
: A set of helper functions to parse SHOGun
+entities into JavaScript/OpenLayers instances.See the following example to get an idea on how the classes can be utilized:
+import Keycloak from 'keycloak-js';
import Map from 'ol/Map';
import SHOGunApplicationUtil from '@terrestris/shogun-util/dist/parser/SHOGunApplicationUtil';
import SHOGunAPIClient from '@terrestris/shogun-util/dist/service/SHOGunAPIClient';
// Create the (optional) Keycloak connector. This is required if bearer token authentication
// is needed inside you project setup only.
const keycloak = new Keycloak({
url: 'https://localhost/auth',
realm: 'SHOGunRealm',
clientId: 'SHOGunClient'
});
// Initialize the keycloak client.
keycloak.init({
onLoad: 'check-sso'
});
// Create the client to easily connect to a SHOGun instance, e.g. to get an
// application configuration.
const client = new SHOGunAPIClient({
// The path to SHOGun.
url: '/api',
// The (optional) keycloak connector.
keycloak: keycloak
});
// Create the parser to transform SHOGun entities into OpenLayers instances.
const parser = new SHOGunApplicationUtil({
client
});
// Get the application with ID 1909.
const application = await client.application().findOne(1909);
// Get the map view.
const view = await parser.parseMapView(application);
// Parse the layers.
const layers = await parser.parseLayerTree(application);
// And build the map.
const map = new Map({
view,
layers
});
+
+
+npm run watch:buildto
can be used to inject an updated version of shogun-util
into another project.
+The script will also watch for further changes.
npm run watch:buildto ../shogun-gis-client/node_modules/@terrestris/shogun-util/
+
+
+Optional
accessOptional
attributesOptional
clientOptional
idOptional
nameOptional
pathOptional
realmOptional
subOptional
crossOptional
downloadOptional
editableOptional
editOptional
featureOptional
hoverableOptional
maxOptional
minOptional
opacityOptional
propertyOptional
searchableOptional
searchOptional
attributionOptional
legendOptional
matrixOptional
requestOptional
resolutionsOptional
tileOptional
tileOptional
useOptional
wmtsOptional
attributesOptional
clientOptional
compositeOptional
compositesOptional
containerOptional
descriptionOptional
idOptional
nameOptional
scopeOptional
createdOptional
credentialOptional
idOptional
priorityOptional
secretOptional
temporaryOptional
typeOptional
userOptional
valueOptional
accessOptional
applicationOptional
attributesOptional
clientOptional
clientOptional
createdOptional
credentialsOptional
disableableOptional
emailOptional
emailOptional
enabledOptional
federatedOptional
federationOptional
firstOptional
groupsOptional
idOptional
lastOptional
notOptional
originOptional
realmOptional
requiredOptional
selfOptional
serviceOptional
socialOptional
totpOptional
usernameConst
Const
Const
The keycloak instance.
+