diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c980ba7dabba33308a0b7e6d7f41b6e13ece97c..5fd6d4fcbc6f22c94e953cf5d482e0d56f743dce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* [#172](https://gitlab.com/caosdb/caosdb-webui/-/issues/172) - Map can handle + geo locations in list of references. + ### Changed ### Deprecated diff --git a/misc/map_test_data.py b/misc/map_test_data.py index 657a01f254b6d7ea2a24a54035d167f621c0c3c5..eda56c0ef06fc73b42d062e4fe7536aaf49b8286 100755 --- a/misc/map_test_data.py +++ b/misc/map_test_data.py @@ -8,7 +8,6 @@ import caosdb import random caosdb.get_connection()._login() -caosdb.execute_query("FIND ENTITY WITH ID > 99").delete() # data model datamodel = caosdb.Container() diff --git a/src/core/js/caosdb.js b/src/core/js/caosdb.js index 0df57dd4095cb3efb325d68821007cae8c55f13b..5a30ce554e265bf1f27814e54573daf8b5a0c4a3 100644 --- a/src/core/js/caosdb.js +++ b/src/core/js/caosdb.js @@ -734,6 +734,16 @@ var _constructXpaths = function (selectors) { * * `getPropertyValues(entities, [["Geo Location", "latitude"], ["Geo Location", "longitude"]])` * + * When the entitieshave normal non-list references to the "Geo Location" the + * result looks like this: + * + * `[[ "50", "-39"], ...]` + * + * When the entities have a LIST of thre Geo Locations the result looks like + * this: + * + * `[[[ "50", "51", "52"], [ "-39", "-38", "-37" ]], ...]`. + * * Use empty strings for selector elements when the property name is irrelevant: * * `getPropertyValues(entities, [["", "latitude"], ["", "longitude"]])` @@ -748,9 +758,11 @@ var _constructXpaths = function (selectors) { * special cases ("name", "description", "unit", etc.) are to be added when * needed. * - * @param {XMLElement[]) entities + * @param {XMLElement[]} entities * @param {String[][]} selectors - * @return {String[][]} A table of the property values for each entity. + * @return {String[][]} A table of the property values for each entity (index + * order is `[row][column]`). Each row is an entity, each column is a value + * (or an array of values, when the entity has list properties). */ var getPropertyValues = function (entities, selectors) { const entity_iter = entities.evaluate("/Response/Record", entities);