Skip to content

Commit

Permalink
Merge pull request #9 from conterra/bugfix_result-ui_support
Browse files Browse the repository at this point in the history
Bugfix result UI support
  • Loading branch information
matthiasstein authored Aug 13, 2024
2 parents 7ffa34a + 427fb5f commit 47de66c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 243 deletions.
232 changes: 0 additions & 232 deletions src/main/js/apps/sample/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,6 @@
"url": "https://services.conterra.de/arcgis/rest/services/mapapps/stoerung/FeatureServer/0",
"definitionExpression": "art = 2"
},
{
"title": "PegelOnline WMS",
"url": "http://www.pegelonline.wsv.de/webservices/gis/wms?VERSION=1.1.1",
"type": "WMS",
"opacity": 0.5
},
{
"title": "BKG WebAtlasDE - Grau",
"url": "http://sg.geodatenzentrum.de/wmts_webatlasde.light_grau",
"type": "WMTS",
"opacity": 0.5
},
{
"id": "wmsnwalkis",
"url": "https://www.wms.nrw.de/geobasis/wms_nw_dvg?",
"type": "WMS",
"title": "WMS NW DVG",
"description": "Die Digitalen Verwaltungsgrenzen beinhalten für ganz NRW die aus dem Basis-DLM abgeleiteten Verwaltungsgrenzen des Landes, der Regierungsbezirke, der Kreise und kreisfreien Städte sowie der Kommunen. Die Ableitung erfolgt einmal jährlich zum 01.10. und entspricht dann dem Fortführungsstand des Basis-DLMs. Bei wesentlichen Änderungen finden weitere Aktualisierungen statt. Die Digitalen Verwaltungsgrenzen sind besonders als räumliche Bezugsgrundlage für den Aufbau von Geo- und Fachinformationssystemen, als Hintergrundinformation für die Überlagerung mit fachspezifischen Daten sowie für die rechnergestützte Bearbeitung thematischer Karten geeignet. Der Dienst basiert auf den Grenzen des Datensatzes DVG2, der ca. 10% der Punkte des DVG1 enthält und eine Genauigkeit von 50 m hat.",
"copyright": "Die ist ein toller langer Text mit mehr als 2000 Zeichen und deßhalb sieht man den super duper mehr Knopp. Und weil es so schön ist steht hier sogar noch mehr unsinniger Kram. imer merhr und mehr und mehr text text text text text text text text text text text text text text text text text text text text text text text text",
"visible": true,
"opacity": 0.5
},
{
"id": "koeln3",
"title": "${map.koeln3.title}",
Expand Down Expand Up @@ -231,216 +209,6 @@
}
}
]
},
{
"id": "koeln2",
"title": "${map.koeln2.title}",
"url": "https://services.conterra.de/arcgis/rest/services/common/koeln/MapServer",
"coverImage": "resource('${app}:/images/mapflow_education.png')",
"type": "AGS_DYNAMIC",
"visible": false,
"sublayers": [
{
"title": "${map.koeln2.libraries.title}",
"id": 7,
"popupTemplate": {
"title": "{NAME_LANG}",
"content": [
{
"type": "fields",
"fieldInfos": [
{
"fieldName": "NAME_LANG",
"label": "${common.name}"
},
{
"fieldName": "ADRESSE",
"label": "${common.address}"
},
{
"fieldName": "PLZ",
"label": "${common.zip}"
}
]
}
]
}
},
{
"title": "${map.koeln2.museums.title}",
"id": 6,
"popupTemplate": {
"title": "Museum",
"content": [
{
"type": "text",
"text": "${map.koeln2.museums.text}"
},
{
"type": "fields",
"fieldInfos": [
{
"fieldName": "ADRESSE",
"label": "${common.address}"
},
{
"fieldName": "STADTBEZIR",
"label": "${common.precint}"
},
{
"fieldName": "HYPERLINK",
"label": "${common.furtherinfo}"
}
]
}
]
}
},
{
"title": "${map.koeln2.schools.title}",
"id": 5,
"popupTemplate": {
"title": "{NAME}",
"content": [
{
"type": "fields",
"fieldInfos": [
{
"fieldName": "SCHULNAME",
"label": "${common.name}"
},
{
"fieldName": "ADRESSE",
"label": "${common.address}"
},
{
"fieldName": "SCHULART",
"label": "{common.type}"
},
{
"fieldName": "TRAEGER",
"label": "${common.provider}"
}
]
}
]
}
}
]
},
{
"id": "koeln1",
"title": "${map.koeln1.title}",
"url": "https://services.conterra.de/arcgis/rest/services/common/koeln/MapServer",
"coverImage": "resource('${app}:/images/mapflow_gi.png')",
"type": "AGS_DYNAMIC",
"visible": false,
"sublayers": [
{
"title": "${map.koeln1.districts.title}",
"id": 11,
"opacity": 0.5,
"popupTemplate": {
"title": "{STV_NAME}",
"content": [
{
"type": "text",
"text": "${map.koeln1.districts.text}"
}
]
}
},
{
"title": "${map.koeln1.boroughs.title}",
"id": 10,
"opacity": 0.5,
"popupTemplate": {
"title": "{NAME}",
"content": [
{
"type": "text",
"text": "${map.koeln1.boroughs.text}"
},
{
"type": "fields",
"fieldInfos": [
{
"fieldName": "expression/area",
"format": {
"places": 2,
"digitSeparator": true
}
},
{
"fieldName": "expression/area-rel",
"format": {
"places": 2,
"digitSeparator": true
}
}
]
}
],
"expressionInfos": [
{
"name": "area",
"title": "${common.area}",
"expression": "$feature.FLAECHE / 10000"
},
{
"name": "area-rel",
"title": "${common.totalArea}",
"expression": "Round(($feature.FLAECHE / 405020000)*100,2)"
}
]
}
},
{
"title": "${map.koeln1.precints.title}",
"id": 9,
"opacity": 0.5,
"popupTemplate": {
"title": "{NAME}",
"content": [
{
"type": "text",
"text": "${map.koeln1.precints.text}"
},
{
"type": "fields",
"fieldInfos": [
{
"fieldName": "expression/area",
"format": {
"places": 2,
"digitSeparator": true
}
},
{
"fieldName": "expression/area-rel",
"format": {
"places": 2,
"digitSeparator": true
}
}
]
}
],
"expressionInfos": [
{
"name": "area",
"title": "${common.area}",
"expression": "$feature.FLAECHE / 10000"
},
{
"name": "area-rel",
"title": "${common.totalArea}",
"expression": "Round(($feature.FLAECHE / 405020000)*100,2)"
}
]
}
}
]
}
],
"ground": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ export default class DatatableActionDefinitionFactory {
trigger(tocItem: TocItem): void {
const ref = tocItem.ref;
let id = ref.id;
let title = ref?.title;
if (ref?.type === "map-image") {
id = `${id}/${ref.sublayers.items[0].id}`;
title = ref.sublayers.items[0].title;
} else if (ref?.layer?.type === "map-image") {
id = `${ref.layer.id}/${id}`;
title = ref.layer.title;
}
const storeProps = {
id: `action_store_${new Date().getTime()}`,
Expand All @@ -87,20 +90,12 @@ export default class DatatableActionDefinitionFactory {
store.load().then(async () => {
// result-ui is used
if (that._resultViewerService) {
const idsProvider = async ({ limit }) => {
const result = await store.query({}, {
count: limit
});
return {
ids: result.map((item) => item.id)
};
};

const dataTableFactory = that._resultViewerService.dataTableFactory;
const dataTable = await dataTableFactory.createDataTableFromStoreAndQuery({
dataTableTitle: store.title || store.id || i18n.searchResultTitle,
dataTableTitle: title || store.title || store.id || i18n.searchResultTitle,
dataSource: store,
idsProvider
queryExpression: {},
queryOptions: {}
});

const dataTableCollection = dataTableFactory.createDataTableCollection([dataTable]);
Expand Down

0 comments on commit 47de66c

Please sign in to comment.