8.0.0 • Published 6 days ago

@terrestris/shogun-gis-client v8.0.0

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
6 days ago

SHOGun GIS client

This repository contains the default WebGIS client used within the SHOGun project.

The client was initialized with create-react-geo-app.

Installation 💾

We recommend to install the client via the prebuilt Docker image docker-public.terrestris.de/terrestris/shogun-gis-client.

Usage 🖱️

Even if the client can be used without any backend providing a context configuration, it is designed to run on top of a SHOGun backend while reading the configuration from the /applications REST interface. To specify a configuration the query parameter applicationId must be set (e.g. https://localhost/client/?applicationId=18 to get the configuration for the application with the ID 18). If no ID is given (e.g. because no backend is available) or the requested application is not accessible, the client will load a fallback configuration. It is possible to load the application config from a static URL with the configuration parameter staticAppConfigUrl.

Print

To use print apps for different languages just name them after the language code (ISO_639-1). The print app that has the name of the currently selected language will be used.

Configuration 🎨

Several global settings for the client can be configured via the gis-client-config.js file:

NameDescriptionDefault
shogunBaseThe base URL of SHOGun, e.g. /api or https://my-shogun.org/. If set to false no SHOGUN requests will be made by the application.'/'
staticAppConfigUrlAn URL to load an application configuration, this does not have to come frome shogun but has to have the same syntax (See https://github.com/terrestris/shogun-util/blob/main/src/model/Application.ts).undefined
layerConfigUrlAn URL to load a list of layers, this does not have to come from shogun but has to have the same syntax (See https://github.com/terrestris/shogun-util/blob/main/src/model/Layer.ts).undefined
keycloak.enabledWhether Keycloak is used for authentication or not. Usually this should only set to false in client only mode or if no authentication is needed to access any SHOGun endpoints at allfalse
keycloak.hostThe Keycloak host, e.g. https://localhost/authnull
keycloak.realmThe Keycloak realm that should be used for authentication, e.g. SHOGunnull
keycloak.clientIdThe Keycloak client that should be used for authentication, e.g. shogun-clientnull
keycloak.onLoadActionSee here for details'check-sso'
print.urlThe url of the MapFish Print servlet'/print'
pluginsThe list of plugins to be loaded[]
plugin.nameThe name of the pluginundefined
plugin.exposedPathsThe list of exposed pathsundefined
plugin.resourcePathThe resource pathundefined
geoserver.baseThe base url of the GeoServer'/geoserver'
geoserver.upload.workspaceThe workspace the uploads should be placed in'SHOGUN'
geoserver.upload.limitThe upload size limit in bytes (note: this is the client evaluation only!)200000000 (= 200MB)
geoserver.upload.authorizedRolesThe list of role names the upload should be allowed/visible to (note: this is the client evaluation only!)'admin'
featureEditRoles.authorizedRolesForCreateThe list of role names the feature editing tools including the create options should be allowed/visible to (note: this is the client evaluation only!). String and regular expressions are supported.[]
featureEditRoles.authorizedRolesForUpdateThe list of role names the feature editing tools including the update options should be allowed/visible to (note: this is the client evaluation only!). String and regular expressions are supported.[]
featureEditRoles.authorizedRolesForDeleteThe list of role names the feature editing tools including the delete options should be allowed/visible to (note: this is the client evaluation only!). String and regular expressions are supported.[]
wfsLockFeatureEnabledWhether WFS LockFeature is enabled during feature editing or not.false
enableFallbackConfigWhether the default application configuration should be loaded without any given application ID or not.true
search.solrBasePathBase path to a solr instance.'/search/query'
search.coreNameSolr core name.'search'
search.defaultUseViewBoxWhether the search is restricted to the current view box.true
search.useNominatimWhether to use Nominatim.true
search.useSolrHighlightingEnable / disable solr search result highlighting.true
search.delayDelay in milliseconds before search is triggered (debouncing).1000
search.minCharsMinimum search term length for the search to be triggered.3
search.solrQueryConfig.queryParserSolr query parser. Must be either 'lucene', 'dismax' or 'edismax''edismax'
search.solrQueryConfig.rowsPerQueryNumber of requested rows per solr query.100
search.solrQueryConfig.tagPreHTML tag applied before search highlight.<b>
search.solrQueryConfig.tagPostHTML tag applied after search highlight.</b>
search.solrQueryConfig.requireFieldMatchOnly query terms aligning with the field being highlighted will in turn be highlighted.true

The configuration file is not bundled and will be loaded before application start from ./gis-client-config.js. Typically you want to override the file in a production environment and you can pass a custom file by mounting the desired one directly into the nginx container of the client. For example:

version: '3.7'
services:
  shogun-gis-client:
    image: docker-public.terrestris.de/terrestris/shogun-gis-client:latest
    volumes:
      - ./gis-client-config.js:/usr/share/nginx/html/gis-client-config.js
    (…)

The shogun-docker repository shows an alternative (and the preferred) way by providing the configuration file out of the root-nginx service while having support for dynamic environment variable replacement.

Development 🧑‍💻

Checkout the repository and install all required dependencies via

npm i

While it's absolutely possible to run the client via

npm run start

to have the application available at https://localhost:8080 you usually want to start the full SHOGun stack for development. Please refer to the shogun-docker repository for further details.

End-to-End testing using Playwright

Ensure using the latest version of the E2E-Test package:

npm update @terrestris/shogun-e2e-tests

Set your domain including potential paths as the ´process.env.HOST´ variable in the global-setup.js. For example:

shogun.terrestris.de

To run the E2E-tests locally just use the following command in the commandline:

npx playwright test

Road to production 🏭

The build artifact of the client can either be built via

npm run build

or directly included in an nginx based Docker image via:

docker build -t shogun-gis-client:1.0.0 .

Run docker run -p 80:80 shogun-gis-client:1.0.0 to start it locally.

Contributing 💫

In short: yes, please contribute as you see fit 😊, we're looking forward to your input.

Be bold and open PRs and issues for anything that bugs you or for all the ideas you want to share. We'd be happy to help you make your first steps or even bigger changes.

8.0.0

6 days ago

7.5.3

11 days ago

7.5.2

16 days ago

7.5.1

1 month ago

7.5.0

1 month ago

7.4.0

2 months ago

7.3.1

3 months ago

7.3.0

4 months ago

7.2.0

4 months ago

7.1.1

5 months ago

7.1.0

5 months ago

7.0.0

5 months ago

6.11.0

7 months ago

6.13.3

6 months ago

6.13.2

6 months ago

6.13.1

6 months ago

6.13.0

6 months ago

6.8.1

9 months ago

6.8.0

9 months ago

6.12.0

7 months ago

6.10.0

7 months ago

6.7.0

10 months ago

6.9.0

8 months ago

6.6.3

10 months ago

6.6.1

10 months ago

6.6.0

10 months ago

6.6.2

10 months ago

6.5.0

11 months ago

6.4.0

11 months ago

6.1.0

12 months ago

6.0.0

12 months ago

6.3.0

11 months ago

6.2.0

12 months ago

6.1.1

12 months ago

5.2.1

1 year ago

5.2.0

1 year ago

5.1.3

1 year ago

5.1.2

1 year ago

5.1.1

1 year ago

5.1.0

1 year ago

5.0.0

1 year ago

4.13.0

1 year ago

4.11.0

1 year ago

4.10.1

1 year ago

4.12.0

1 year ago

4.10.2

1 year ago

4.12.1

1 year ago

4.10.3

1 year ago

4.12.2

1 year ago

4.10.0

1 year ago

4.9.0

1 year ago

4.8.1

1 year ago

4.8.0

1 year ago

4.7.1

2 years ago

4.7.0

2 years ago

4.6.0

2 years ago

4.5.1

2 years ago

4.5.0

2 years ago

4.4.0

2 years ago

4.3.1

2 years ago

4.1.0

2 years ago

4.3.0

2 years ago

4.2.1

2 years ago

4.2.0

2 years ago

4.1.1

2 years ago

4.0.0

2 years ago