Skip to content

Commit

Permalink
add datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Jan 26, 2021
1 parent fe74410 commit 9ef7792
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ import { GeoJsonFileSource } from '../sources/geojson_file_source';

export class GeoJsonFileField extends AbstractField implements IField {
private readonly _source: GeoJsonFileSource;
private readonly _dataType: string;

constructor({
fieldName,
source,
origin,
dataType,
}: {
fieldName: string;
source: GeoJsonFileSource;
origin: FIELD_ORIGIN;
dataType: string;
}) {
super({ fieldName, origin });
this._source = source;
this._dataType = dataType;
}

getSource(): IVectorSource {
Expand All @@ -32,4 +36,8 @@ export class GeoJsonFileField extends AbstractField implements IField {
async getLabel(): Promise<string> {
return this.getName();
}

async getDataType(): Promise<string> {
return this._dataType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class GeoJsonFileSource extends AbstractVectorSource {
fieldName: descriptor.name,
source: this,
origin: FIELD_ORIGIN.SOURCE,
dataType: descriptor.type,
});
}

Expand All @@ -82,6 +83,7 @@ export class GeoJsonFileSource extends AbstractVectorSource {
fieldName: field.name,
source: this,
origin: FIELD_ORIGIN.SOURCE,
dataType: field.type,
});
});
}
Expand Down

0 comments on commit 9ef7792

Please sign in to comment.