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.
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.
{ββ
"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.
{
"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.
{ββ
"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:
{
/** ## 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.
{ββββββ
"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.