Configuration
This section lists all the configuration entries available in GeoGirafe, and how to configure them.
The whole configuration is done in the config.json
file.
Every configuration option that has no default value must be set properly to make the application work.
Basemaps
The list of basemaps available in the application is loaded from the themes.json
file.
In addition, you can use the basemaps
section to configure additional options.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
show | Boolean | Display the basemap control or not. If set to false , the basemap controller won't be visible in the application. | true | true , false |
defaultBasemap | String | Name of the default basemap, that will be displayed when the application starts. This is the name of the background map available in themes.json . | 'Empty' | background_color , swissimage |
OSM | Boolean | Enable or disable OpenStreetMap as an additional basemap layer. | false | true , false |
SwissTopoVectorTiles | Boolean | Enable or disable the VectorTiles layer from Swisstopo as an additional basemap layer. | false | true , false |
emptyBasemap | Boolean | Enable or disable the empty basemap. | true | true , false |
CSV
The csv
section contains the configuration options to format CSV file to download.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
encoding | String | The encoding of the file. | utf-8 | iso-8859-3 |
extension | String | The extension of the file. | .csv | .txt |
includeHeader | Boolean | Include the header (columns titles). | true | false |
quote | String | The symbol to use to as simple quote. | ' | " |
separator | String | The values separator. | , | ; |
Drawing
The drawing
section contains the configuration options when drawing features on the map.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
defaultFillColor | String | Default fill color used when drawing features on the map. | #6666ff7f | any color value in #RGBA format |
defaultStrokeColor | String | Default stroke color used when drawing features on the map. | #0000ff | any color value in #RGBA format |
defaultStrokeWidth | Number | Default stroke width used when drawing features on the map. | 2 | any integer |
defaultTextSize | Number | Default text size used when drawing features on the map. | 12 | any integer |
defaultFont | String | Default font used when drawing features on the map. | Arial | Arial , Tahoma , Verdana |
defaultVertexRadius | Number | Default symbol size used to show feature vertices. | 8 | any integer |
defaultVertexFillColor | String | Default fill color used to show feature vertices. | #ffffffbf | any color value in #RGBA format |
defaultVertexStrokeWidth | Number | Default stroke width used to show feature vertices. | 2 | any integer |
General
The general
section contains all the common configuration entries that can be used by any component.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
locale | String | Locale used when formatting numbers or dates in the application. For example this locale will be used to format the coordinates. | en-US | de-CH , fr-FR |
logLevel | String | Log level of the application. When defining a log level, all logs of this level and above will be displayed in the console.
In development mode, the log level is forced to debug . | warn | debug , info , warn , error |
GmfAuth
The gmfauth
section is optional and contains configuration options for GeoMapFish Standard (legacy) authentication protocol.
If the geogirafe client is not running on the same domain as the GMF backend, the GMF Backend needs to be configured. Follow this steps to make it work:
- You can manage CORS outside geoportal, for example with an lua script at the in the haproxy configuration. If you want to manage it within your geoportal, in the vars.yaml add CORS. Example:
# Control the HTTP headers
headers:
dynamic: &header {}
index: *header
api: *header
apihelp: *header
profile: *header
raster: *header
vector_tiles: *header
error: *header
themes: &auth_header
cache_control_max_age: 600 # 10 minutes
cache_control_max_age_nocache: 10 # 10 seconds, to avoid too many call
access_control_max_age: 600 # 10 minutes
access_control_allow_origin:
- '{VISIBLE_WEB_PROTOCOL}://{VISIBLE_WEB_HOST}'
- 'https://app.localhost:8080'
- 'https://demo.geomapfish.dev'
headers:
Strict-Transport-Security: max-age=31536000; includeSubDomains
config: *auth_header
print: *auth_header
fulltextsearch: {}
mapserver: *auth_header
tinyows: *auth_header
layers: *auth_header
shortener: *auth_header
login: *auth_header
Theses vars need to be updated. At the bottom of the vars.yaml, add the update_paths to the existing list:
update_paths:
- headers.dynamic.headers
- headers.index.headers
- headers.api.headers
- headers.apihelp.headers
- headers.profile.headers
- headers.raster.headers
- headers.vector_tiles.headers
- headers.error.headers
- headers.themes.headers
- headers.config.headers
- headers.print.headers
- headers.fulltextsearch.headers
- headers.mapserver.headers
- headers.tinyows.headers
- headers.layers.headers
- headers.shortener.headers
- headers.login.headers
- The frontend domain has to be allowed as referer in the
vars.yaml
file:
authorized_referers:
- 'https://app.localhost:8080/'
- 'https://demo.geomapfish.dev/'
- In your
env.project
The variableAUTHTKT_SAMESITE
has to be set toNone
, to allow authentication cookies to be sent to the backend from another domain.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
url | String | URL to the GeoMapFish backend. | - | https://map.cartoriviera.ch |
checkSessionOnLoad | Boolean | Whether geogirafe should immediately check on page load whether the user is connected to the issuer (implies back and forth redirects to the issuer and geogirafe). | true | true , false |
loginRequired | Boolean | Whether a login is required when the applicatoin starts. If true , the application will force the user to login before he can use the application. | false | true , false |
Interface
The interface
section contains the default settings for the layout and active component of the applications.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
defaultSelectionComponent | String | The name of the selection component to be displayed per default. This can be window or 'grid', or another value if you have a custom plugin. The corresponding component must also exist in your HTML and script code. | window | grid |
Languages
The languages
section contains an option for each available language in the application plus other options is an Array
of language
.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
translations | Object | An object containing the list of available translations identified by their shortname. The corresponding value is an array of links to the JSON files containing the translations as value. | - |
|
defaultLanguage | String | The shortname of the default language that will be used when the application starts. | - | en , fr , de |
Lidar
The lidar
section contains the configuration options for the LIDAR profile.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
url | String | Link to a pytree service with LIDAR data and configuration. | - | https://sitn.ne.ch/pytree |
Map
The map
section contains the configuration of the OpenLayers
map.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
srid | String | Default SRID of the map. | - | EPSG:2056 |
scales | Array | Array of scales allowed on the map. | - | [200000, 75000, 40000, 20000, 10000, 7500, 5000, 3500, 2000, 1000, 500, 200, 100, 50] |
startPosition | String | Initial center position when the application starts. | - | 2611000,1267000 |
startZoom | Integer | Initial zoom level when the application starts. | - | any valid integer for the map zoom level |
maxExtent | String | Maximum extent for the map. If not set, the map cover the entire world. | - | 2583000,1235000,2650000,1291000 |
constrainScales | Boolean | If true , the map will only be allowed to used the specific scales defined in maps.scales .If false , any scale is allowed. | true | true , false |
showScaleLine | Boolean | Show scale line on the map, or not. | true | true , false |
Map3D
The map3d
section contains the configuration of the Cesium
globe.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
terrainUrl | String | URL for the 3D map terrain. | - | https://terrain100.geo.admin.ch/1.0.0/ch.swisstopo.terrain.3d/ |
terrainImagery | Object | See below | - | - |
terrainImagery.url | String | The URL of your imagery provider (WMTS in your case), with template parameters as described in the Cesium documentation. | - | https://wmts20.geo.admin.ch/1.0.0/ch.swisstopo.swissimage-product/default/current/4326/{z}/{x}/{y}.jpeg |
terrainImagery.srid | Integer | The SRID of the service used for terrainImagery. Only 4326 and 3857 are supported. | 4326 | 4326 , 3857 |
terrainImagery.minLoD | Integer | The minimal level-of-detail that the imagery provider supports, if not mentioned, when zooming very far, the map may try to load nonexistent tiles that cause network error. | - | any integer that represents a valid level-of-details |
terrainImagery.maxLoD | Integer | Same as minLoD but for maximal level-of-detail, to prevent loading nonexistent tiles when zooming very close. | - | any integer that represents a valid level-of-details |
terrainImagery.coverageArea | Array | The rectangle, in degree, that describe the area provided by your WMTS. This parameter prevents requesting tiles that do not exist on the WMTS. | - | [5.013926957923385, 45.35600133779394, 11.477436312994008, 48.27502358353741] |
tilesetsUrls | Array | Array of URLs for 3D map tilesets. | - | ["https://3d.geo.bs.ch/static/tiles/a57b8783-1d7b-4ca9-b652-d4ead5436ead_2/tileset.json"] |
Metadata
The metadata
section contains the configuration options for the Metadata window.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
metadataUrlPrefix | String | URL Prefix to use when accessing metadata links, if there are defined with relative paths in themes.json . | '' | https://map.geo.bs.ch |
defaultWindowWidth | String | Default width of the metadata window, in CSS units. | 960px | 500px , 20rem |
defaultWindowHeight | String | Default height of the metadata window, in CSS units. | 460px | 350px , 10rem |
OAuth
The oauth
section is optional and contains configuration options for Oauth Open ID connect (OIDC) authentication. In this model, the user is redirected to an issuer
to prove his identity, redirecting back to geogirafe with a token. Geogirafe then sends this token to log in to GeoMapFish. This implementation should support any generic OIDC issuer. As of this writing it has been validated with Keycloak (used by Basel-Stadt).
Name | Type | Description | Default | Examples |
---|---|---|---|---|
issuer | Object | |||
issuer.url | String | URL for the OIDC issuer's authorization endpoint. | - | https://auth.geo.bs.ch/auth/realms/geobs |
issuer.clientId | String | Client Identifier of the GeoMapFish client application. | - | MapBS-ui |
issuer.algorithm | String | OIDC algorithm oauth should use. Possible values: oidc , oauth2 | oidc | oidc , oauth2 |
issuer.scope | String | The scope or scopes requested during the authentication process. Scopes determine the level of access and the type of information that the application can retrieve about the user. Default is openid , which is necessary for OIDC. You can include additional scopes like profile or email for more user information. | openid | openid , profile , email |
issuer.codeChallengeMethod | String | Specifies the method used for transforming the code challenge when using the Proof Key for Code Exchange (PKCE) extension. This enhances security during the authorization process. | S256 | plain , S256 |
issuer.checkSessionOnLoad | Boolean | Whether geogirafe should immediately check on page load whether the user is connected to the issuer (implies back and forth redirects to the issuer and geogirafe). | false | true , false |
issuer.loginRequired | Boolean | Whether a login is required when the applicatoin starts. If true , the application will force the user to login before he can use the application. | false | true , false |
geomapfish | Object | |||
geomapfish.loginUrl | String | URL to send the issuer's token to login to GeoMapFish-Keycloak. | - | https://map.geo.test.bs.ch/KeycloakLogin |
geomapfish.logoutUrl | String | URL to end the session on GeoMapFish-Keycloak (note: doesn't end the issuer's session). | - | https://map.geo.test.bs.ch/KeycloakLogout |
geomapfish.userInfoUrl | String | URL to get user's details from GeoMapFish-Keycloak. | - | https://map.geo.test.bs.ch/loginuser |
geomapfish.anonymousUsername | String | Hitting the geomapfish.userInfoUrl endpoint when unlogged yields an anonymous user with a username . the anonymousUsername is used to check whether the user is unlogged on Geomapfish-Keycloak. | - | service-account-service_mapbs_anonymous |
Offline
The offline
section contains the configuration for the offline usage of GeoGirafe.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
downloadStartZoom | Number | The number of the zoom level from which downloading tiles for usage in offline mode will be allowed. | - | any number corresponding to a valid zoom level |
downloadEndZoom | Number | The zoom level to which tiles will be downloaded for an usage in offline mode. | - | any number corresponding to a valid zoom level |
Print
The print
section contains the configuration options for the print.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
url | String | Link to the GeoMapFish-Compliant Print Service. | - | https://map.geo.bs.ch/printproxy/ |
formats | String[] | The desired print formats. The provided format must be supported by MapFishPrint. The order is kept in the dropdown. | ["png", "pdf"] | ["png", "pdf", "jpg"] |
defaultFormat | String | The print format selected by default. Only used if listed in formats and supported by MapFishPrint. | - | "pdf" |
layouts | String[] | A list of allowed layouts name. If configured, the layouts will be filtered using this value. | - | ["1 A4 portrait", "2 A3 landscape"] |
defaultLayout | String | The print layout selected by default. Only used if the name match a layout. | - | "1 A4 portrait" |
scales | Number | A list of allowed scales for every layouts. If configured, the scales will be filtered using this value. | - | [50000, 25000, 10000, 2500, 1000] |
attributeNames | String | The print attributes (optional fields) to display as inputs in the panel. The order is kept in the panel. | - | ["legend", "title", "comments"] |
legend | Object | The options for the print legend. See below. | - | - |
legend.useExtent | boolean | Use or not the bbox to get the WMS legend. For QGIS server only. | true | false |
legend.showGroupsTitle | boolean | Display or not groups title in the legend. Switching to false is useful to obtains a "flat" legend. | true | false |
legend.label | Object<string, boolean> | The key is the server type (MapServer, QGIS, etc.), if the value is false the name of the layer will be not displayed. This is used to avoid duplicated title, as text and in the legend image. | - | {"mapserver": false} |
legend.params | Object<string, <Object<string, unknown>> | The key is the server type (MapServer, QGIS, etc.) or image for an URL from a metadata. The value is some additional parameters set in the query string. | - | {"mapserver": {"filter": "house"}} |
Projections
The projections
section contains the list of projection that are available in the application.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
projections | String | An array containing the list of EPSG coordinate systems with their name. | - |
|
Query
The query
section contains the configuration options for the query result window.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
legacy | Boolean | Allow less restricted parsing of query result value, allowing some JavaScript events to be whitelisted. Currently supports: - onclick | false | true |
Search
The search
section contains the configuration options for the search.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
url | String | Link to the GeoMapFish-Compliant Search Service. This service has to be compatible with the format of the GeoMapFish Search-Service. The link should contain the following strings: - ###SEARCHTERM### : will be replaced by the text to search.- ###SEARCHLANG### : will be replaced by the search language. | - | https://map.geo.bs.ch/search?limit=90&partitionlimit=15&interface=desktop&query=###SEARCHTERM###&lang=###SEARCHLANG### |
objectPreview | boolean | Activate or not the object preview on the map when navigating through the search results. | false | true , false |
layerPreview | boolean | Activate or not the layer preview on the map when navigating through the search results. | false | true , false |
minResolution | number | Configure the minimum resolution to zoom to when searching for an object. Is the object is very small (a point for example), the zoom will stop to this resolution. | 0.5 | any number |
defaultFillColor | String | Define the default fill color of the polygon features of the search results. | #3388ff7f | - |
defaultStrokeColor | String | Define the default stroke color of the line and polygon features of the search results. | #3388ff | - |
defaultStrokeWidth | number | Define the default stroke width of the line and polygon features of the search results. | 2 | any number |
paintSearchResults | boolean | Configure if the user can choose the color of the search results in the user interface. | true | true , false |
Selection
The selection
section contains the configuration options for the selected/focused features on the map.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
maxFeature | Integer | Limit of requested object for every single WFS request. | 300 | 100 |
defaultFillColor | String | Default fill color used when selecting an object in the map. | #ff66667f | any color value in #RGBA format |
defaultStrokeColor | String | Default stroke color used when selecting an object in the map. | #ff3333 | any color value in #RGBA format |
defaultStrokeWidth | Integer | Default stroke width used when selecting an object in the map. | 4 | any integer |
highlightFillColor | String | Default fill color used when highlighting or focusing an object in the map. | #ff33337f | any color value in #RGBA format |
highlightStrokeColor | String | Default stroke color used when highlighting or focusing an object in the map. | #ff0000 | any color value in #RGBA format |
highlightStrokeWidth | Integer | Default stroke width used when highlighting or focusing an object in the map. | 4 | any integer |
Share
The share
section contains the configuration options for the short links.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
service | String | Type of ShortUrl service we want to use. Supported configuration are: - gmf : the GeoMapFish backend shortUrl service will be used.- lstu : the open-source service Let's Shorten That URL will be used. | gmf | gmf , lstu |
createUrl | String | The URL that will be used to create the shortUrl. | - | https://lstu.fr/a |
Themes
The themes
section contains the configuration options linked to the themes.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
url | String | Link to the GeoMapFish-Compliant themes.json | - | Mock/themes.json , https://map.geo.bs.ch/themes?background=background&interface=desktop |
defaultTheme | String | Name of the default theme, that will be automatically loaded on application start. | '' | main , cadastre |
imagesUrlPrefix | String | URL Prefix to use when accessing themes images, if there are defined with relative paths in themes.json . | '' | https://map.geo.ti.ch |
showErrorsOnStart | Boolean | If true , the errors listed in themes.json will be displayed when the application starts. If false , they won't be displayed. | false | true , false |
selectionMode | String | If replace , only one theme can be active at the same time, and during the selection of a new theme the current theme is replaced. If add , many themes can be active at the same time, and selecting a new theme adds it at the beginning of the tree view. | replace | replace , add |
Treeview
The treeview
section contains the configuration options for the layertree.
Name | Type | Description | Default | Examples |
---|---|---|---|---|
hideLegendWhenLayerIsDeactivated | Boolean | If true , the legend of a layer will automatically be hidden if the layer is not activated. If false , the legend will remain visible even if the layer is deactivated. | true | true , false |
defaultIconSize | Object | The size of the legend icons (getLegend WMS Url) can be configured here with the width and height properties. Defaults to 20 x 20 if not set. | - | - |
defaultIconSize.width | Integer | Width of the icon that will be used for legend icons | 20 | any integer |
defaultIconSize.height | Height | Width of the icon that will be used for legend icons | 20 | any integer |