Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mwu2018 committed Sep 5, 2023
1 parent 0e7fa5a commit 73ab838
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions lib/Models/Catalog/Esri/ArcGisMapServerCatalogItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export default class ArcGisMapServerCatalogItem extends UrlMixin(
return result;
}

private getTimeIntervalFromDimensions(): TimeParams | undefined {
private getTimeParamsFromDimensions(): TimeParams | undefined {
if (
this.modelDimensions.length < 1 ||
this.modelDimensions[0].selectedId === undefined
Expand Down Expand Up @@ -456,17 +456,12 @@ export default class ArcGisMapServerCatalogItem extends UrlMixin(

@computed
private get _currentImageryParts(): ImageryParts | undefined {
const ti = this.getTimeIntervalFromDimensions();
// const dateAsUnix: string | undefined =
// this.currentDiscreteTimeTag === undefined
// ? undefined
// : new Date(this.currentDiscreteTimeTag).getTime().toString();

const timeParams = this.getTimeParamsFromDimensions();
const imageryProvider = this._createImageryProvider({
time: this.getCurrentTime(ti),
interval: ti?.interval,
timeUnit: ti?.timeUnit,
isForward: ti?.isForward
time: this.getCurrentTime(timeParams),
interval: timeParams?.interval,
timeUnit: timeParams?.timeUnit,
isForward: timeParams?.isForward
});
if (imageryProvider === undefined) {
return undefined;
Expand All @@ -486,12 +481,12 @@ export default class ArcGisMapServerCatalogItem extends UrlMixin(
!this.isPaused &&
this.nextDiscreteTimeTag
) {
const ti = this.getTimeIntervalFromDimensions();
const timeParams = this.getTimeParamsFromDimensions();
const imageryProvider = this._createImageryProvider({
time: this.getCurrentTime(ti),
interval: ti?.interval,
timeUnit: ti?.timeUnit,
isForward: ti?.isForward
time: this.getCurrentTime(timeParams),
interval: timeParams?.interval,
timeUnit: timeParams?.timeUnit,
isForward: timeParams?.isForward
});
if (imageryProvider === undefined) {
return undefined;
Expand Down

0 comments on commit 73ab838

Please sign in to comment.