From b33f4b37b5f087dc60d1b59b7d6e4535f4d104f9 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 13 Jul 2020 13:43:33 -0600 Subject: [PATCH 1/6] [Maps] get isClustered from count request instead of source data request --- .../data_request_descriptor_types.ts | 4 +--- .../blended_vector_layer/blended_vector_layer.ts | 13 ++++--------- .../es_geo_grid_source/es_geo_grid_source.js | 1 - .../sources/es_search_source/es_search_source.js | 1 - 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts index 1bd8c5401eb1d..35b33da12d384 100644 --- a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts +++ b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts @@ -5,7 +5,7 @@ */ /* eslint-disable @typescript-eslint/consistent-type-definitions */ -import { RENDER_AS, SORT_ORDER, SCALING_TYPES, SOURCE_TYPES } from '../constants'; +import { RENDER_AS, SORT_ORDER, SCALING_TYPES } from '../constants'; import { MapExtent, MapQuery } from './map_descriptor'; import { Filter, TimeRange } from '../../../../../src/plugins/data/common'; @@ -26,12 +26,10 @@ type ESSearchSourceSyncMeta = { scalingType: SCALING_TYPES; topHitsSplitField: string; topHitsSize: number; - sourceType: SOURCE_TYPES.ES_SEARCH; }; type ESGeoGridSourceSyncMeta = { requestType: RENDER_AS; - sourceType: SOURCE_TYPES.ES_GEO_GRID; }; export type VectorSourceSyncMeta = ESSearchSourceSyncMeta | ESGeoGridSourceSyncMeta | null; diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts index 26a0ffc1b1a37..4fb9e51429782 100644 --- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts @@ -11,7 +11,6 @@ import { getDefaultDynamicProperties } from '../../styles/vector/vector_style_de import { IDynamicStyleProperty } from '../../styles/vector/properties/dynamic_style_property'; import { IStyleProperty } from '../../styles/vector/properties/style_property'; import { - SOURCE_TYPES, COUNT_PROP_LABEL, COUNT_PROP_NAME, LAYER_TYPE, @@ -187,14 +186,10 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer { this._clusterStyle = new VectorStyle(clusterStyleDescriptor, this._clusterSource, this); let isClustered = false; - const sourceDataRequest = this.getSourceDataRequest(); - if (sourceDataRequest) { - const requestMeta = sourceDataRequest.getMeta(); - if ( - requestMeta && - requestMeta.sourceMeta && - requestMeta.sourceMeta.sourceType === SOURCE_TYPES.ES_GEO_GRID - ) { + const countDataRequest = this.getDataRequest(ACTIVE_COUNT_DATA_ID); + if (countDataRequest) { + const countRequestData = countDataRequest.getData(); + if (countRequestData && countRequestData.isSyncClustered) { isClustered = true; } } diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.js b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.js index 1be74140fe1bf..3902709eeb841 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.js +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.js @@ -63,7 +63,6 @@ export class ESGeoGridSource extends AbstractESAggSource { getSyncMeta() { return { requestType: this._descriptor.requestType, - sourceType: SOURCE_TYPES.ES_GEO_GRID, }; } diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.js b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.js index 330fa6e8318ed..256becf70ffb0 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.js +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.js @@ -540,7 +540,6 @@ export class ESSearchSource extends AbstractESSource { scalingType: this._descriptor.scalingType, topHitsSplitField: this._descriptor.topHitsSplitField, topHitsSize: this._descriptor.topHitsSize, - sourceType: SOURCE_TYPES.ES_SEARCH, }; } From 028db6a23389cef7565b2c4574d3b38426095f3b Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 13 Jul 2020 13:49:43 -0600 Subject: [PATCH 2/6] better naming --- .../layers/blended_vector_layer/blended_vector_layer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts index 4fb9e51429782..5786fc5fdd8ca 100644 --- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts @@ -188,8 +188,8 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer { let isClustered = false; const countDataRequest = this.getDataRequest(ACTIVE_COUNT_DATA_ID); if (countDataRequest) { - const countRequestData = countDataRequest.getData(); - if (countRequestData && countRequestData.isSyncClustered) { + const requestData = countDataRequest.getData(); + if (requestData && requestData.isSyncClustered) { isClustered = true; } } From 539cfa9a8b9949e5ddc8acdd2eace4cf59f30c4c Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 13 Jul 2020 16:30:15 -0600 Subject: [PATCH 3/6] tslint --- .../layers/blended_vector_layer/blended_vector_layer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts index 5786fc5fdd8ca..3b4265efbc131 100644 --- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts @@ -40,6 +40,10 @@ import { IVectorSource } from '../../sources/vector_source'; const ACTIVE_COUNT_DATA_ID = 'ACTIVE_COUNT_DATA_ID'; +interface CountData { + isSyncClustered: boolean; +} + function getAggType(dynamicProperty: IDynamicStyleProperty): AGG_TYPE { return dynamicProperty.isOrdinal() ? AGG_TYPE.AVG : AGG_TYPE.TERMS; } @@ -188,7 +192,7 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer { let isClustered = false; const countDataRequest = this.getDataRequest(ACTIVE_COUNT_DATA_ID); if (countDataRequest) { - const requestData = countDataRequest.getData(); + const requestData = countDataRequest.getData() as CountData; if (requestData && requestData.isSyncClustered) { isClustered = true; } From e0cdd1c6c6ccf804d88325acbca90ab5097af882 Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Tue, 14 Jul 2020 15:44:48 -0400 Subject: [PATCH 4/6] make ts-typing explicit --- .../server/maps_telemetry/maps_telemetry.ts | 49 ++++++++++++------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts index 5f57d666b9f74..ad52f9b8216d3 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts @@ -12,7 +12,7 @@ import { } from 'kibana/server'; import { IFieldType, IIndexPattern } from 'src/plugins/data/public'; import { SOURCE_TYPES, ES_GEO_FIELD_TYPE, MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; -import { LayerDescriptor } from '../../common/descriptor_types'; +import { AbstractSourceDescriptor, LayerDescriptor } from '../../common/descriptor_types'; import { MapSavedObject } from '../../common/map_saved_object_type'; // @ts-ignore import { getInternalRepository } from '../kibana_server_services'; @@ -82,6 +82,33 @@ function getIndexPatternsWithGeoFieldCount(indexPatterns: IIndexPattern[]) { }; } +function getEMSLayerCount(layerLists: LayerDescriptor[][]): ILayerTypeCount[] { + return layerLists.map((layerList: LayerDescriptor[]) => { + const countsById = _(layerList).countBy((layer: LayerDescriptor) => { + const isEmsFile = + layer.sourceDescriptor !== null + ? layer.sourceDescriptor.type === SOURCE_TYPES.EMS_FILE + : false; + const id = (layer.sourceDescriptor as AbstractSourceDescriptor).id; + return isEmsFile && id ? id : 'false'; + }); + + const emsCountsById = countsById.pickBy((val, key) => key !== 'false'); + const layerTypeCount = emsCountsById.value(); + return layerTypeCount as ILayerTypeCount; + }) as ILayerTypeCount[]; +} + +export function getLayerLists(mapSavedObjects: MapSavedObject[]): LayerDescriptor[][] { + return mapSavedObjects.map((savedMapObject) => { + const layerList = + savedMapObject.attributes && savedMapObject.attributes.layerListJSON + ? JSON.parse(savedMapObject.attributes.layerListJSON) + : []; + return layerList as LayerDescriptor[]; + }); +} + export function buildMapsTelemetry({ mapSavedObjects, indexPatternSavedObjects, @@ -91,17 +118,13 @@ export function buildMapsTelemetry({ indexPatternSavedObjects: IIndexPattern[]; settings: SavedObjectAttribute; }): SavedObjectAttributes { - const layerLists = mapSavedObjects.map((savedMapObject) => - savedMapObject.attributes && savedMapObject.attributes.layerListJSON - ? JSON.parse(savedMapObject.attributes.layerListJSON) - : [] - ); + const layerLists: LayerDescriptor[][] = getLayerLists(mapSavedObjects); const mapsCount = layerLists.length; - const dataSourcesCount = layerLists.map((lList) => { + const dataSourcesCount = layerLists.map((layerList: LayerDescriptor[]) => { // todo: not every source-descriptor has an id // @ts-ignore - const sourceIdList = lList.map((layer: LayerDescriptor) => layer.sourceDescriptor.id); + const sourceIdList = layerList.map((layer: LayerDescriptor) => layer.sourceDescriptor.id); return _.uniq(sourceIdList).length; }); @@ -109,15 +132,7 @@ export function buildMapsTelemetry({ const layerTypesCount = layerLists.map((lList) => _.countBy(lList, 'type')); // Count of EMS Vector layers used - const emsLayersCount = layerLists.map((lList) => - _(lList) - .countBy((layer: LayerDescriptor) => { - const isEmsFile = _.get(layer, 'sourceDescriptor.type') === SOURCE_TYPES.EMS_FILE; - return isEmsFile && _.get(layer, 'sourceDescriptor.id'); - }) - .pickBy((val, key) => key !== 'false') - .value() - ) as ILayerTypeCount[]; + const emsLayersCount = getEMSLayerCount(layerLists); const dataSourcesCountSum = _.sum(dataSourcesCount); const layersCountSum = _.sum(layersCount); From 2020a38cf3fdf5a3b16152abd683271f0fa42b94 Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Tue, 14 Jul 2020 19:23:23 -0400 Subject: [PATCH 5/6] add unit tests --- .../maps_telemetry/maps_telemetry.test.js | 22 +++++++------ .../server/maps_telemetry/maps_telemetry.ts | 8 +++-- .../sample_map_saved_objects.json | 33 +++++++++++++++++++ 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.test.js b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.test.js index 6131ff45c4a0f..a447c4ae7ce84 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.test.js +++ b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.test.js @@ -22,6 +22,7 @@ describe('buildMapsTelemetry', () => { indexPatternsWithGeoFieldCount: 0, indexPatternsWithGeoPointFieldCount: 0, indexPatternsWithGeoShapeFieldCount: 0, + geoShapeAggLayersCount: 0, attributesPerMap: { dataSourcesCount: { avg: 0, @@ -50,48 +51,49 @@ describe('buildMapsTelemetry', () => { indexPatternsWithGeoFieldCount: 3, indexPatternsWithGeoPointFieldCount: 2, indexPatternsWithGeoShapeFieldCount: 1, + geoShapeAggLayersCount: 2, attributesPerMap: { dataSourcesCount: { - avg: 2.6666666666666665, + avg: 2, max: 3, - min: 2, + min: 1, }, emsVectorLayersCount: { canada_provinces: { - avg: 0.3333333333333333, + avg: 0.2, max: 1, min: 1, }, france_departments: { - avg: 0.3333333333333333, + avg: 0.2, max: 1, min: 1, }, italy_provinces: { - avg: 0.3333333333333333, + avg: 0.2, max: 1, min: 1, }, }, layerTypesCount: { TILE: { - avg: 1, + avg: 0.6, max: 1, min: 1, }, VECTOR: { - avg: 1.6666666666666667, + avg: 1.2, max: 2, min: 1, }, }, layersCount: { - avg: 2.6666666666666665, + avg: 2, max: 3, - min: 2, + min: 1, }, }, - mapsTotalCount: 3, + mapsTotalCount: 5, settings: { showMapVisualizationTypes: false, }, diff --git a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts index c7367336b8810..9cdf16654d318 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts @@ -114,8 +114,12 @@ function getEMSLayerCount(layerLists: LayerDescriptor[][]): ILayerTypeCount[] { function isGeoshapeIndexPattern( indexPatterns: IIndexPattern[], indexPatternId: string, - geoField: string + geoField: string | undefined ): boolean { + if (!geoField) { + return false; + } + const matchIndexPattern = indexPatterns.find((indexPattern: IIndexPattern) => { return indexPattern.id === indexPatternId; }); @@ -133,7 +137,7 @@ function isGeoshapeIndexPattern( return field.name === geoField; }); - return matchField && matchField.type === ES_GEO_FIELD_TYPE.GEO_SHAPE; + return !!matchField && matchField.type === ES_GEO_FIELD_TYPE.GEO_SHAPE; } function isGeoShapeAggLayer(indexPatterns: IIndexPattern[], layer: LayerDescriptor): boolean { diff --git a/x-pack/plugins/maps/server/maps_telemetry/test_resources/sample_map_saved_objects.json b/x-pack/plugins/maps/server/maps_telemetry/test_resources/sample_map_saved_objects.json index 017f9e69ffe46..82a8035c77dc7 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/test_resources/sample_map_saved_objects.json +++ b/x-pack/plugins/maps/server/maps_telemetry/test_resources/sample_map_saved_objects.json @@ -43,5 +43,38 @@ ], "updated_at": "2019-01-31T23:19:55.855Z", "version": 1 + }, + { + "type": "gis-map", + "id": "643da1e6-c628-11ea-87d0-0242ac130003", + "attributes": { + "title": "Single cluster layer with geo_shape field", + "description": "", + "mapStateJSON": "{\"zoom\":2.12,\"center\":{\"lon\":-88.67592,\"lat\":34.23257},\"timeFilters\":{\"from\":\"now-15m\",\"to\":\"now\",\"mode\":\"quick\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"lucene\"}}", + "layerListJSON": "[{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"51afb7d0-c628-11ea-87d0-0242ac130003\",\"geoField\":\"geometry\",\"metrics\":[{\"type\":\"count\"}],\"requestType\":\"point\",\"resolution\":\"COARSE\",\"indexPatternId\":\"4a7f6010-0aed-11ea-9dd2-95afd7ad44d4\"},\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"color\":\"Blues\",\"colorCategory\":\"palette_0\",\"field\":{\"name\":\"doc_count\",\"origin\":\"source\"},\"fieldMetaOptions\":{\"isEnabled\":true,\"sigma\":3},\"type\":\"ORDINAL\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":0}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"minSize\":7,\"maxSize\":32,\"field\":{\"name\":\"doc_count\",\"origin\":\"source\"},\"fieldMetaOptions\":{\"isEnabled\":true,\"sigma\":3}}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"name\":\"doc_count\",\"origin\":\"source\"}}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"id\":\"8d384d5d-6353-468f-b8f8-8eaa487358c4\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"visible\":true,\"type\":\"VECTOR\",\"joins\":[]}]", + "uiStateJSON": "{}" + }, + "references": [ + ], + "updated_at": "2019-01-31T23:19:55.855Z", + "version": 1 + }, + { + "type": "gis-map", + "id": "5efd136a-c628-11ea-87d0-0242ac130003", + "attributes": { + "title": "Single heatmap layer with geo_shape field", + "description": "", + "mapStateJSON": "{\"zoom\":2.12,\"center\":{\"lon\":-88.67592,\"lat\":34.23257},\"timeFilters\":{\"from\":\"now-15m\",\"to\":\"now\",\"mode\":\"quick\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"lucene\"}}", + "layerListJSON": "[{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"51afb7d0-c628-11ea-87d0-0242ac130003\",\"geoField\":\"geometry\",\"metrics\":[{\"type\":\"count\"}],\"requestType\":\"heatmap\",\"resolution\":\"COARSE\",\"indexPatternId\":\"4a7f6010-0aed-11ea-9dd2-95afd7ad44d4\"},\"id\":\"52eade74-1c78-4e18-8670-2061f38b613b\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"HEATMAP\",\"colorRampName\":\"theclassic\"},\"type\":\"HEATMAP\",\"joins\":[]}]", + "uiStateJSON": "{}" + }, + "references": [ + ], + "updated_at": "2019-01-31T23:19:55.855Z", + "version": 1 } + ] + + From 29d7fad7cbd5c823f1f848413e4f6c1bcfdc79d5 Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Wed, 15 Jul 2020 12:03:44 -0400 Subject: [PATCH 6/6] feedback --- .../server/maps_telemetry/maps_telemetry.ts | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts index 9cdf16654d318..f0286d7e5811f 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts @@ -96,22 +96,23 @@ function getIndexPatternsWithGeoFieldCount(indexPatterns: IIndexPattern[]) { function getEMSLayerCount(layerLists: LayerDescriptor[][]): ILayerTypeCount[] { return layerLists.map((layerList: LayerDescriptor[]) => { - const countsById = _(layerList).countBy((layer: LayerDescriptor) => { - const isEmsFile = - layer.sourceDescriptor !== null - ? layer.sourceDescriptor.type === SOURCE_TYPES.EMS_FILE - : false; - const id = (layer.sourceDescriptor as AbstractSourceDescriptor).id; - return isEmsFile && id ? id : 'false'; + const emsLayers = layerList.filter((layer: LayerDescriptor) => { + return ( + layer.sourceDescriptor !== null && + layer.sourceDescriptor.type === SOURCE_TYPES.EMS_FILE && + (layer.sourceDescriptor as AbstractSourceDescriptor).id + ); + }); + const emsCountsById = _(emsLayers).countBy((layer: LayerDescriptor) => { + return (layer.sourceDescriptor as AbstractSourceDescriptor).id; }); - const emsCountsById = countsById.pickBy((val, key) => key !== 'false'); const layerTypeCount = emsCountsById.value(); return layerTypeCount as ILayerTypeCount; }) as ILayerTypeCount[]; } -function isGeoshapeIndexPattern( +function isFieldGeoShape( indexPatterns: IIndexPattern[], indexPatternId: string, geoField: string | undefined @@ -155,22 +156,20 @@ function isGeoShapeAggLayer(indexPatterns: IIndexPattern[], layer: LayerDescript const sourceDescriptor: SourceDescriptor = layer.sourceDescriptor; if (sourceDescriptor.type === SOURCE_TYPES.ES_GEO_GRID) { - return isGeoshapeIndexPattern( + return isFieldGeoShape( indexPatterns, (sourceDescriptor as ESGeoGridSourceDescriptor).indexPatternId, (sourceDescriptor as ESGeoGridSourceDescriptor).geoField ); - } else if (sourceDescriptor.type === SOURCE_TYPES.ES_SEARCH) { - const isGeoShapeIndexPattern = isGeoshapeIndexPattern( + } else if ( + sourceDescriptor.type === SOURCE_TYPES.ES_SEARCH && + (sourceDescriptor as ESSearchSourceDescriptor).scalingType === SCALING_TYPES.CLUSTERS + ) { + return isFieldGeoShape( indexPatterns, (sourceDescriptor as ESSearchSourceDescriptor).indexPatternId, (sourceDescriptor as ESSearchSourceDescriptor).geoField ); - - return ( - isGeoShapeIndexPattern && - (sourceDescriptor as ESSearchSourceDescriptor).scalingType === SCALING_TYPES.CLUSTERS - ); } else { return false; }