Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions configure/src/metaconfigs/layer-model-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,13 @@
"description": "This is a property key already within the features properties. It's value will be searched for in the specified dataset column.",
"type": "text",
"width": 3
},
{
"field": "displayProp",
"name": "Connecting Feature Display Name Property",
"description": "This is a property key within the returned dataset feature properties. This is effectively an optional second-order property key. In the case of multiple dataset row entries being returned, this is useful for users of the UI to be able to distinguish between them. If unset, defaults to the value of 'Connecting Feature Property'.",
"type": "text",
"width": 3
}
]
}
Expand Down
7 changes: 7 additions & 0 deletions configure/src/metaconfigs/layer-query-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,13 @@
"description": "This is a property key already within the features properties. It's value will be searched for in the specified dataset column.",
"type": "text",
"width": 3
},
{
"field": "displayProp",
"name": "Connecting Feature Display Name Property",
"description": "This is a property key within the returned dataset feature properties. This is effectively an optional second-order property key. In the case of multiple dataset row entries being returned, this is useful for users of the UI to be able to distinguish between them. If unset, defaults to the value of 'Connecting Feature Property'.",
"type": "text",
"width": 3
}
]
}
Expand Down
7 changes: 7 additions & 0 deletions configure/src/metaconfigs/layer-vector-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,13 @@
"description": "This is a property key already within the features properties. It's value will be searched for in the specified dataset column.",
"type": "text",
"width": 3
},
{
"field": "displayProp",
"name": "Connecting Feature Display Name Property",
"description": "This is a property key within the returned dataset feature properties. This is effectively an optional second-order property key. In the case of multiple dataset row entries being returned, this is useful for users of the UI to be able to distinguish between them. If unset, defaults to the value of 'Connecting Feature Property'.",
"type": "text",
"width": 3
}
]
}
Expand Down
7 changes: 7 additions & 0 deletions configure/src/metaconfigs/layer-vectortile-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,13 @@
"description": "This is a property key already within the features properties. It's value will be searched for in the specified dataset column.",
"type": "text",
"width": 3
},
{
"field": "displayProp",
"name": "Connecting Feature Display Name Property",
"description": "This is a property key within the returned dataset feature properties. This is effectively an optional second-order property key. In the case of multiple dataset row entries being returned, this is useful for users of the UI to be able to distinguish between them. If unset, defaults to the value of 'Connecting Feature Property'.",
"type": "text",
"width": 3
}
]
}
Expand Down
62 changes: 62 additions & 0 deletions src/essence/Ancillary/Datasets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import F_ from '../Basics/Formulae_/Formulae_'
import calls from '../../pre/calls'

const Datasets = {
populateFromDataset(layer, cb) {
if (
layer.options.layerName &&
L_.layers.data[layer.options.layerName] &&
L_.layers.data[layer.options.layerName].variables &&
L_.layers.data[layer.options.layerName].variables.datasetLinks
) {
const dl =
L_.layers.data[layer.options.layerName].variables.datasetLinks
let dlFilled = dl
for (let i = 0; i < dlFilled.length; i++) {
dlFilled[i].search = F_.getIn(
layer.feature.properties,
dlFilled[i].prop.split('.')
)
}

calls.api(
'datasets_get',
{
queries: JSON.stringify(dlFilled),
},
function (data) {
const d = data.body
for (let i = 0; i < d.length; i++) {
if (d[i].type == 'images') {
layer.feature.properties.images =
layer.feature.properties.images || []
for (let j = 0; j < d[i].results.length; j++) {
layer.feature.properties.images.push(
d[i].results[j]
)
}
//remove duplicates
layer.feature.properties.images =
F_.removeDuplicatesInArrayOfObjects(
layer.feature.properties.images
)
} else {
layer.feature.properties._dataset = {
prop: dlFilled[i].displayProp || d[i].prop,
results: d[i].results,
}
}
}
if (cb != null && typeof cb === 'function') cb()
},
function (data) {
if (cb != null && typeof cb === 'function') cb()
}
)
} else {
if (cb != null && typeof cb === 'function') cb()
}
},
}

export default Datasets
2 changes: 2 additions & 0 deletions src/essence/Basics/Layers_/Layers_.js
Original file line number Diff line number Diff line change
Expand Up @@ -2054,6 +2054,8 @@ const L_ = {
const featureWithout_ = JSON.parse(JSON.stringify(f))
if (featureWithout_.properties?._ != null)
delete featureWithout_.properties._
if (featureWithout_.properties?._dataset != null)
delete featureWithout_.properties._dataset

for (let i = 0; i < layerKeys.length; i++) {
const l = layerKeys[i]
Expand Down
Loading