10.5.1 • Published 4 months ago

@terrestris/shogun-util v10.5.1

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
4 months ago

SHOGun-Util

Connect to a SHOGun instance with ease.

Installation

npm i @terrestris/shogun-util

Usage

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
});

Development

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/
10.5.1

4 months ago

10.5.0

4 months ago

10.4.2

5 months ago

10.4.3

5 months ago

10.4.1

6 months ago

10.4.0

6 months ago

10.2.1

6 months ago

10.3.0

6 months ago

10.2.0

8 months ago

10.0.1

8 months ago

10.1.0

8 months ago

10.0.0

9 months ago

9.1.1

9 months ago

9.1.0

9 months ago

8.8.1

10 months ago

8.8.0

10 months ago

8.8.2

10 months ago

8.4.0

1 year ago

8.6.0

11 months ago

8.3.0

1 year ago

8.5.0

1 year ago

8.3.2

1 year ago

8.3.1

1 year ago

8.7.0

11 months ago

8.5.1

11 months ago

8.3.3

1 year ago

7.4.0

11 months ago

9.0.1

10 months ago

9.0.0

10 months ago

7.2.0-ol7.4

1 year ago

8.2.0

1 year ago

7.2.0-ol7.3

1 year ago

8.1.0

1 year ago

7.2.0-ol7.2

1 year ago

7.1.1-ol7.1

1 year ago

7.2.0-ol7.1

1 year ago

7.3.2

1 year ago

8.0.1

1 year ago

8.0.0

1 year ago

7.1.1

2 years ago

7.3.1

2 years ago

6.1.0

2 years ago

7.3.0

2 years ago

7.1.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

7.0.0

2 years ago

7.2.0

2 years ago

7.0.1

2 years ago

5.7.0

2 years ago

5.6.2

2 years ago

5.6.0

2 years ago

5.6.1

2 years ago

5.5.0

2 years ago

5.4.1

2 years ago

5.3.2

2 years ago

5.4.0

2 years ago

5.3.1

2 years ago

5.3.0

2 years ago

5.2.0

2 years ago

5.1.0

2 years ago

5.0.0

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.2.1

3 years ago

4.1.2

3 years ago

4.2.0

3 years ago

3.7.0

3 years ago

4.1.0

3 years ago

4.0.0

3 years ago

4.1.1

3 years ago

3.6.0

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.2.2

3 years ago

3.1.3

3 years ago

1.2.0

3 years ago

3.3.0

3 years ago

3.2.1

3 years ago

3.1.2

3 years ago

1.1.0

3 years ago

3.2.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.4.1

3 years ago

3.0.0

3 years ago

1.2.1

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago