Skip to main content

Common Configuration

SAMO Browser consists of samo-map/samo-lids-browser component, which has to be defined on the desired page among with the context. Definition of the basic SAMO Dynamic App structure has to fit to the version you are implementing. For our exmaple we use following structure:

dynamic-app
β”‚
└───samo-demo
β”‚
└───components
β”‚
└───configuration
β”‚
└───resources
β”‚
└───configuration.json

Some individual files are descriebd in this documentation. For the full description of all files, refer to the explicit part in Lighthouse.

Components​

boot.js​

boot.js describes the startup behaviour of the defined application. Here you can set the starting part, page and which client should be used. Additionally, the available iconset SAMO (internal) is defined which is loaded on startup of the application.

boot.js configuration example
document.title = "SAMO LIDS Browser";

var bootHelper = window.samo.bootHelper;
window.samo.dynamicBoot({
clientId: "samo-lids-browser-client",
defaultPart: "browser",
defaultPage: "default",
defaultLanguage: "en",

extraResources: [
bootHelper.prepareScriptResource("resources/themes/samo.js")
],
});

Configuration​

For a simple Web GIS solution (as replacement of the old LIDS Browser), one application with one part with one page has to exist. Following a simple configuration structure with some individual files specificly described.

dynamic-app
β”‚
└───samo-demo\configuration
β”‚
└───application
β”‚
└───parts
β”‚ └───browser
β”‚ └───pages
β”‚ β”‚ └───pg_default.json
β”‚ └───part.json
└───shared
β”‚ └───applicationModules
β”‚ β”‚ └───recent-entities.json
β”‚ β”‚ └───user.json
β”‚ └───pages
β”‚ └───login.json
β”‚ └───logout.json
β”‚ └───profile.json
└───application.json

Application​

Localization and available languages are the main part of the application.json.

using SAMO Browser in a single page - application.json configuration example
{​​
"debug": "${dynamic_app_debug!false}",
"logo": "images/samo.png",
"localizationResources": [
"strings/common",
"strings/maps"
],
"languages": [
{
"id": "de",
"title": "Deutsch",
"locales": [
"de"
],
"icon": "de.svg"
},
{
"id": "cz",
"title": "Česky",
"locales": [
"cz"
],
"icon": "cz.svg"
},
{
"id": "en",
"title": "English",
"locales": [
"en"
],
"icon": "en.svg"
}
],
"settings": {
"forms": {
"inputs": {
"date": {
"readOnly": false
}
}
}
}
}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Part​

The part.json describes which shared pages/modules are also accessible through our SAMO LIDS Browser application. Usually those are login, logout, profile/user and recent-entities. When implementing you are free to include also reports, messages and others.

using SAMO Browser in a single page - part.json configuration example
{
"defaultPage": "default",
"defaultGuestPage": "login",
"shared": {
"pages": [
"login",
"logout",
"profile"
],
"applicationModules": [
"recent-entities",
"user"
]
}
}

Page​

The starting page is described for the individual SAMO Gateway Application in \components\boot.js. In our example, this leads to default.json page in part browser. This starting page only consists of module samo-lids-browser. The detailed configuration is in its context: \map\samo-lids-browser.json.

using SAMO Browser in a single page - default.json configuration example
{​​
"title": "SAMO LIDS Browser",
"security": {​​​​​​​​​
"loggedIn": true
}​​​​​​​​​​​​​​​​​​​​​​​,
"hideMenu": true,
"module": {​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
"type": "component:samo-map/samo-lids-browser",
"context": "samo-lids-browser"
}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Map​

Most important part of the configuration is in the map context. Each project should contain some default context of the SAMO Browser. The samo-lids-browser.json configuration file needs to be created in the following folder structure:

dynamic-app
β”‚
└───samo-demo\configuration
β”‚
└───map
β”‚
└───samo-lids-browser.json

Containing the following configuration:

default SAMO Browser context - configuration example
{
/** ## See Basic Configuration ## **/
"srsName": "EPSG:31467",
"defaultCenterX": 3451632,
"defaultCenterY": 5481774,
"defaultZoom": 6,
"scales": [
200000,
100000,
50000,
20000,
10000,
5000,
2000,
1000,
500,
200,
100
],
"restoreState": true,
"legends": {
"water": {
"src": "resource:legends/water.png"
},
"commons": {
"src": "resource:legends/common_objects.png"
}
},
/** ## See Toolbars Configuration ## **/
"toolbarsConfiguration": {
"context": "default-toolbar"
},
/** ## See Databar Configuration ## **/
"databar": {
"context": "default-databar"
},
/** ## See Layers Configuration ## **/
"layers": [
{
"id": "cat_5040000",
"legends": [
"commons"
]
},
{
"id": "setdefinition_80425981052865018"
},
{
"id": "cat_5060000"
},
"bd_06",
"external-osm-wms"
],
"backdropLayers": [
{
"id": "tms_orthophoto_2014",
"preview": "images/backdrops/orto2014.png"
},
{
"id": "bd_03",
"title": "City Map",
"preview": "images/backdrops/cityMap.png"
}
]
}

SAMO Browser supports multiple contexts, that can be extended and provide multiple pages with the same access rights configuration. All additional context need a new page definition in application\parts or even an individual part. This is often the case if we have multiple Map Viewers (for different Agendas) in one SAMO project.

simple SAMO Browser context extending the default - configuration example
{​​​​​​
"extends": "samo-lids-browser",
"layers": [
{​​​​​​
"id": "setdefinition_705890760039974",
"icon": "samo-demo-icons:water",
"legends": [
"water"
],
"visible": true
}​​​​​​
]
}​​​​​​

To have the possibility to set individual access rights for individual SAMO LIDS Browser implementations, you have to define individual applications.