diff --git a/src/components/spatialdisplay/SpatialDisplayComponent.vue b/src/components/spatialdisplay/SpatialDisplayComponent.vue index 0c1a47699..c76cc515a 100644 --- a/src/components/spatialdisplay/SpatialDisplayComponent.vue +++ b/src/components/spatialdisplay/SpatialDisplayComponent.vue @@ -14,6 +14,7 @@ :key="layerOptions?.name" :min-value="minElevation" :max-value="maxElevation" + :ticks="elevationTicks" :unit="elevationUnit" > (0) const minElevation = ref(-Infinity) const maxElevation = ref(Infinity) +const elevationTicks = ref() const elevationUnit = ref('') const currentTime = ref(new Date()) @@ -132,6 +134,7 @@ watch( maxElevation.value = max elevationUnit.value = (layer.elevation as ElevationWithUnitSymbol).unitSymbol ?? '' + elevationTicks.value = layer.elevation.irregularTicks } }, { immediate: true, deep: true }, diff --git a/src/components/wms/ElevationSlider.vue b/src/components/wms/ElevationSlider.vue index 163cbc614..ebd761833 100644 --- a/src/components/wms/ElevationSlider.vue +++ b/src/components/wms/ElevationSlider.vue @@ -63,6 +63,7 @@ interface Props { minValue: number maxValue: number unit: string + ticks?: number[] } const props = withDefaults(defineProps(), { @@ -160,6 +161,11 @@ const onValueChange = () => { watch(() => props.modelValue, onValueChange) watchEffect(() => { + if (props.ticks) { + marks.value = props.ticks + return + } + const scale = scaleLinear( [props.minValue, props.maxValue], [props.minValue, props.maxValue],