diff --git a/x-pack/plugins/maps/public/classes/fields/geojson_file_field.ts b/x-pack/plugins/maps/public/classes/fields/geojson_file_field.ts index 38be25054e05a..ae42b09d491c5 100644 --- a/x-pack/plugins/maps/public/classes/fields/geojson_file_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/geojson_file_field.ts @@ -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 { @@ -32,4 +36,8 @@ export class GeoJsonFileField extends AbstractField implements IField { async getLabel(): Promise { return this.getName(); } + + async getDataType(): Promise { + return this._dataType; + } } diff --git a/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts b/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts index 0b84d4a28861b..d0d69fbb5fb86 100644 --- a/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts @@ -72,6 +72,7 @@ export class GeoJsonFileSource extends AbstractVectorSource { fieldName: descriptor.name, source: this, origin: FIELD_ORIGIN.SOURCE, + dataType: descriptor.type, }); } @@ -82,6 +83,7 @@ export class GeoJsonFileSource extends AbstractVectorSource { fieldName: field.name, source: this, origin: FIELD_ORIGIN.SOURCE, + dataType: field.type, }); }); }