Skip to content

Commit

Permalink
introduce new method to indicate whether the data can be read from ge…
Browse files Browse the repository at this point in the history
…ojson
  • Loading branch information
thomasneirynck committed Aug 3, 2020
1 parent f898f21 commit c6ca0d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions x-pack/plugins/maps/public/classes/fields/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export interface IField {
// then styling properties that require the domain to be known cannot use this property.
supportsAutoDomain(): boolean;

// Determinse wheter Maps-app can automatically deterime the domain of the field-values
// _without_ having to retrieve the data as GeoJson
// e.g. for ES-sources, this would use the extended_stats API
supportsFieldMeta(): boolean;

canReadFromGeoJson(): boolean;
}

export class AbstractField implements IField {
Expand Down Expand Up @@ -90,4 +95,8 @@ export class AbstractField implements IField {
supportsAutoDomain(): boolean {
return true;
}

canReadFromGeoJson(): boolean {
return true;
}
}
4 changes: 4 additions & 0 deletions x-pack/plugins/maps/public/classes/fields/mvt_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ export class MVTField extends AbstractField implements IField {
supportsAutoDomain() {
return false;
}

canReadFromGeoJson(): boolean {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class DynamicStyleProperty<T> extends AbstractStyleProperty<T>
}

supportsMbFeatureState() {
return this._field && this._field.supportsAutoDomain();
return this._field && this._field.canReadFromGeoJson();
}

getFieldMetaOptions() {
Expand Down

0 comments on commit c6ca0d4

Please sign in to comment.