Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional types of custom properties in the Cesium map config #1928

Open
3 tasks
robyngit opened this issue Dec 11, 2021 · 0 comments
Open
3 tasks
Labels
cesium enhancement pdg Permafrost Discovery Gateway

Comments

@robyngit
Copy link
Member

Since commit 451d93e, custom properties can be configured for Map Assets in a Cesium Map. Custom properties are properties that are not stored in geospatial features, but may be created from existing properties. These custom properties can be used to conditionally hide features, color-code a layer, or in the feature info template.

For example, imagine that features in a certain vector layer have a "timestamp" property. Timestamps are given in the format 2018-08-16T19:20:30.45+01:00, but it's preferred that the date is displayed in the FeatureInfoView in the friendlier format Thursday, August 16, 2018. This property can be created by adding customProperties to to the configuration for this layer, e.g.:

"layers": [
  {
    "label": "Ice Wedge Polygons",
    "type": "Cesium3DTileset",
    ...
    "customProperties": {
      "friendlyDate": {
        "type": "date",
        "property": "timestamp",
        "format": "dddd, MMMM D, YYYY"
      }
    }
  }
]

The new friendlyDate property can then be referenced like a regular property in any other part of the configuration (featureTemplate, colorPalette, vectorFilters).

So far, the only custom properties that are supported are dates and strings, and the "string" type only allows a static string (i.e. it cannot include other, existing properties.) This goal of this issue is to extend support for custom properties to include:

  • Number formatting (e.g. number of significant digits)
  • Creation of boolean properties based on other properties (e.g. area > 10 -> true)
  • Dynamic strings that can include multiple property values, (e.g. "The area of " + name + " is " + area + " km2") and/or can be partial matches of existing string properties (perhaps using regular expressions)

Note: Shell functions to support these new custom properties exist here, and should be called from here. Each newly supported custom property can be documented here

@robyngit robyngit added enhancement pdg Permafrost Discovery Gateway cesium labels Dec 11, 2021
@mbjones mbjones moved this to Backlog in Visualization/Frontend Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cesium enhancement pdg Permafrost Discovery Gateway
Projects
None yet
Development

No branches or pull requests

1 participant