Skip to content

Commit

Permalink
remove default value logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurmarakana89 committed Feb 20, 2024
1 parent 966daf8 commit e2125bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class TimeSliderEventProcessor extends AbstractEventProcessor {
const defaultValue = temporalDimensionInfo.default;
const minAndMax: number[] = [new Date(range[0]).getTime(), new Date(range[range.length - 1]).getTime()];
const { field, singleHandle } = temporalDimensionInfo;

// If the field type has an alias, use that as a label
let fieldAlias = field;
const { featureInfo } = api.maps[mapId].layer.registeredLayers[layerPath].source!;
Expand All @@ -121,12 +122,7 @@ export class TimeSliderEventProcessor extends AbstractEventProcessor {
const fieldIndex = localizedOutFields ? localizedOutFields.indexOf(field) : -1;
if (fieldIndex !== -1 && localizedAliasFields?.length === localizedOutFields?.length) fieldAlias = localizedAliasFields![fieldIndex];

// eslint-disable-next-line no-nested-ternary
const values = singleHandle
? [new Date(temporalDimensionInfo.default).getTime()]
: defaultValue
? [new Date(defaultValue[0]).getTime(), new Date(defaultValue[1]).getTime()]
: [...minAndMax];
const values = singleHandle ? [new Date(temporalDimensionInfo.default).getTime()] : [...minAndMax];

const sliderData: TimeSliderLayerSet = {
[layerPath]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export type TimeSliderLayerSet = {
[layerPath: string]: TypeTimeSliderValues;
};

// #region INTERFACES
export interface TypeTimeSliderValues {
title?: string;
description?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1500,11 +1500,10 @@ export abstract class AbstractGeoViewLayer {
}

/** ***************************************************************************************************************************
* Change the layer phase property and emit an event to update existing layer sets.
* Change the layer temporal dimension property and emit an event to update existing layer sets.
* Set the layerTemporalDimension for the layer identified by specified layerPath.
*
* @param {string} layerPath The layer path to the layer's configuration affected by the change.
* @param {TimeDimension} timeDimension The value to assign to the layer temporal dimension property.
* @param {TimeDimension} temporalDimension The value to assign to the layer temporal dimension property.
*/
setTemporalDimension(layerPath: string, temporalDimension: TimeDimension): void {
layerPath = layerPath || this.layerPathAssociatedToTheGeoviewLayer;
Expand Down

0 comments on commit e2125bf

Please sign in to comment.