mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Maps] Add SOURCE_TYPES enumeration (#62975)
This commit is contained in:
parent
301b795db6
commit
a6ecd4c278
24 changed files with 86 additions and 74 deletions
|
@ -5,11 +5,11 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { EMS_TMS, LAYER_TYPE } from '../constants';
|
||||
import { SOURCE_TYPES, LAYER_TYPE } from '../constants';
|
||||
|
||||
function isEmsTileSource(layerDescriptor) {
|
||||
const sourceType = _.get(layerDescriptor, 'sourceDescriptor.type');
|
||||
return sourceType === EMS_TMS;
|
||||
return sourceType === SOURCE_TYPES.EMS_TMS;
|
||||
}
|
||||
|
||||
function isTileLayer(layerDescriptor) {
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { ES_GEO_GRID, ES_PEW_PEW, ES_SEARCH } from '../constants';
|
||||
import { SOURCE_TYPES } from '../constants';
|
||||
|
||||
function isEsSource(layerDescriptor) {
|
||||
const sourceType = _.get(layerDescriptor, 'sourceDescriptor.type');
|
||||
return [ES_GEO_GRID, ES_PEW_PEW, ES_SEARCH].includes(sourceType);
|
||||
return [SOURCE_TYPES.ES_GEO_GRID, SOURCE_TYPES.ES_PEW_PEW, SOURCE_TYPES.ES_SEARCH].includes(
|
||||
sourceType
|
||||
);
|
||||
}
|
||||
|
||||
// Migration to move applyGlobalQuery from layer to sources.
|
||||
|
|
|
@ -7,11 +7,15 @@
|
|||
// Can not use public Layer classes to extract references since this logic must run in both client and server.
|
||||
|
||||
import _ from 'lodash';
|
||||
import { ES_GEO_GRID, ES_SEARCH, ES_PEW_PEW } from '../constants';
|
||||
import { SOURCE_TYPES } from '../constants';
|
||||
|
||||
function doesSourceUseIndexPattern(layerDescriptor) {
|
||||
const sourceType = _.get(layerDescriptor, 'sourceDescriptor.type');
|
||||
return sourceType === ES_GEO_GRID || sourceType === ES_SEARCH || sourceType === ES_PEW_PEW;
|
||||
return (
|
||||
sourceType === SOURCE_TYPES.ES_GEO_GRID ||
|
||||
sourceType === SOURCE_TYPES.ES_SEARCH ||
|
||||
sourceType === SOURCE_TYPES.ES_PEW_PEW
|
||||
);
|
||||
}
|
||||
|
||||
export function extractReferences({ attributes, references = [] }) {
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
*/
|
||||
|
||||
import { extractReferences, injectReferences } from './references';
|
||||
import { ES_GEO_GRID, ES_SEARCH, ES_PEW_PEW } from '../constants';
|
||||
import { SOURCE_TYPES } from '../constants';
|
||||
|
||||
const layerListJSON = {
|
||||
esSearchSource: {
|
||||
withIndexPatternId: `[{\"sourceDescriptor\":{\"type\":\"${ES_SEARCH}\",\"indexPatternId\":\"c698b940-e149-11e8-a35a-370a8516603a\"}}]`,
|
||||
withIndexPatternRef: `[{\"sourceDescriptor\":{\"type\":\"${ES_SEARCH}\",\"indexPatternRefName\":\"layer_0_source_index_pattern\"}}]`,
|
||||
withIndexPatternId: `[{\"sourceDescriptor\":{\"type\":\"${SOURCE_TYPES.ES_SEARCH}\",\"indexPatternId\":\"c698b940-e149-11e8-a35a-370a8516603a\"}}]`,
|
||||
withIndexPatternRef: `[{\"sourceDescriptor\":{\"type\":\"${SOURCE_TYPES.ES_SEARCH}\",\"indexPatternRefName\":\"layer_0_source_index_pattern\"}}]`,
|
||||
},
|
||||
esGeoGridSource: {
|
||||
withIndexPatternId: `[{\"sourceDescriptor\":{\"type\":\"${ES_GEO_GRID}\",\"indexPatternId\":\"c698b940-e149-11e8-a35a-370a8516603a\"}}]`,
|
||||
withIndexPatternRef: `[{\"sourceDescriptor\":{\"type\":\"${ES_GEO_GRID}\",\"indexPatternRefName\":\"layer_0_source_index_pattern\"}}]`,
|
||||
withIndexPatternId: `[{\"sourceDescriptor\":{\"type\":\"${SOURCE_TYPES.ES_GEO_GRID}\",\"indexPatternId\":\"c698b940-e149-11e8-a35a-370a8516603a\"}}]`,
|
||||
withIndexPatternRef: `[{\"sourceDescriptor\":{\"type\":\"${SOURCE_TYPES.ES_GEO_GRID}\",\"indexPatternRefName\":\"layer_0_source_index_pattern\"}}]`,
|
||||
},
|
||||
join: {
|
||||
withIndexPatternId:
|
||||
|
@ -23,8 +23,8 @@ const layerListJSON = {
|
|||
'[{"joins":[{"right":{"indexPatternRefName":"layer_0_join_0_index_pattern"}}]}]',
|
||||
},
|
||||
pewPewSource: {
|
||||
withIndexPatternId: `[{\"sourceDescriptor\":{\"type\":\"${ES_PEW_PEW}\",\"indexPatternId\":\"c698b940-e149-11e8-a35a-370a8516603a\"}}]`,
|
||||
withIndexPatternRef: `[{\"sourceDescriptor\":{\"type\":\"${ES_PEW_PEW}\",\"indexPatternRefName\":\"layer_0_source_index_pattern\"}}]`,
|
||||
withIndexPatternId: `[{\"sourceDescriptor\":{\"type\":\"${SOURCE_TYPES.ES_PEW_PEW}\",\"indexPatternId\":\"c698b940-e149-11e8-a35a-370a8516603a\"}}]`,
|
||||
withIndexPatternRef: `[{\"sourceDescriptor\":{\"type\":\"${SOURCE_TYPES.ES_PEW_PEW}\",\"indexPatternRefName\":\"layer_0_source_index_pattern\"}}]`,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { ES_SEARCH, SCALING_TYPES } from '../constants';
|
||||
import { SOURCE_TYPES, SCALING_TYPES } from '../constants';
|
||||
import { LayerDescriptor, ESSearchSourceDescriptor } from '../descriptor_types';
|
||||
import { MapSavedObjectAttributes } from '../../../../../plugins/maps/common/map_saved_object_type';
|
||||
|
||||
function isEsDocumentSource(layerDescriptor: LayerDescriptor) {
|
||||
const sourceType = _.get(layerDescriptor, 'sourceDescriptor.type');
|
||||
return sourceType === ES_SEARCH;
|
||||
return sourceType === SOURCE_TYPES.ES_SEARCH;
|
||||
}
|
||||
|
||||
export function migrateUseTopHitsToScalingType({
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { ES_SEARCH, SORT_ORDER } from '../constants';
|
||||
import { SOURCE_TYPES, SORT_ORDER } from '../constants';
|
||||
|
||||
function isEsDocumentSource(layerDescriptor) {
|
||||
const sourceType = _.get(layerDescriptor, 'sourceDescriptor.type');
|
||||
return sourceType === ES_SEARCH;
|
||||
return sourceType === SOURCE_TYPES.ES_SEARCH;
|
||||
}
|
||||
|
||||
export function topHitsTimeToSort({ attributes }) {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
} from 'src/core/server';
|
||||
import { IFieldType, IIndexPattern } from 'src/plugins/data/public';
|
||||
import {
|
||||
EMS_FILE,
|
||||
SOURCE_TYPES,
|
||||
ES_GEO_FIELD_TYPE,
|
||||
MAP_SAVED_OBJECT_TYPE,
|
||||
TELEMETRY_TYPE,
|
||||
|
@ -100,7 +100,7 @@ export function buildMapsTelemetry({
|
|||
const emsLayersCount = layerLists.map(lList =>
|
||||
_(lList)
|
||||
.countBy((layer: LayerDescriptor) => {
|
||||
const isEmsFile = _.get(layer, 'sourceDescriptor.type') === EMS_FILE;
|
||||
const isEmsFile = _.get(layer, 'sourceDescriptor.type') === SOURCE_TYPES.EMS_FILE;
|
||||
return isEmsFile && _.get(layer, 'sourceDescriptor.id');
|
||||
})
|
||||
.pick((val, key) => key !== 'false')
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
LayerMappingDetails,
|
||||
} from './types';
|
||||
import * as i18n from './translations';
|
||||
import { SOURCE_TYPES } from '../../../../../../plugins/maps/common/constants';
|
||||
const euiVisColorPalette = euiPaletteColorBlind();
|
||||
|
||||
// Update field mappings to modify what fields will be returned to map tooltip
|
||||
|
@ -101,7 +102,7 @@ export const lmc: LayerMappingCollection = {
|
|||
export const getLayerList = (indexPatternIds: IndexPatternMapping[]) => {
|
||||
return [
|
||||
{
|
||||
sourceDescriptor: { type: 'EMS_TMS', isAutoSelect: true },
|
||||
sourceDescriptor: { type: SOURCE_TYPES.EMS_TMS, isAutoSelect: true },
|
||||
id: uuid.v4(),
|
||||
label: null,
|
||||
minZoom: 0,
|
||||
|
@ -260,7 +261,7 @@ export const getLineLayer = (
|
|||
layerDetails: LayerMapping
|
||||
) => ({
|
||||
sourceDescriptor: {
|
||||
type: 'ES_PEW_PEW',
|
||||
type: SOURCE_TYPES.ES_PEW_PEW,
|
||||
applyGlobalQuery: true,
|
||||
id: uuid.v4(),
|
||||
indexPatternId,
|
||||
|
|
|
@ -56,15 +56,18 @@ export enum SORT_ORDER {
|
|||
DESC = 'desc',
|
||||
}
|
||||
|
||||
export const EMS_TMS = 'EMS_TMS';
|
||||
export const EMS_FILE = 'EMS_FILE';
|
||||
export const ES_GEO_GRID = 'ES_GEO_GRID';
|
||||
export const ES_SEARCH = 'ES_SEARCH';
|
||||
export const ES_PEW_PEW = 'ES_PEW_PEW';
|
||||
export const EMS_XYZ = 'EMS_XYZ'; // identifies a custom TMS source. Name is a little unfortunate.
|
||||
export const WMS = 'WMS';
|
||||
export const KIBANA_TILEMAP = 'KIBANA_TILEMAP';
|
||||
export const REGIONMAP_FILE = 'REGIONMAP_FILE';
|
||||
export enum SOURCE_TYPES {
|
||||
EMS_TMS = 'EMS_TMS',
|
||||
EMS_FILE = 'EMS_FILE',
|
||||
ES_GEO_GRID = 'ES_GEO_GRID',
|
||||
ES_SEARCH = 'ES_SEARCH',
|
||||
ES_PEW_PEW = 'ES_PEW_PEW',
|
||||
EMS_XYZ = 'EMS_XYZ', // identifies a custom TMS source. Name is a little unfortunate.
|
||||
WMS = 'WMS',
|
||||
KIBANA_TILEMAP = 'KIBANA_TILEMAP',
|
||||
REGIONMAP_FILE = 'REGIONMAP_FILE',
|
||||
GEOJSON_FILE = 'GEOJSON_FILE',
|
||||
}
|
||||
|
||||
export enum FIELD_ORIGIN {
|
||||
SOURCE = 'source',
|
||||
|
@ -77,8 +80,6 @@ export const SOURCE_META_ID_ORIGIN = `${SOURCE_DATA_ID_ORIGIN}_${META_ID_ORIGIN_
|
|||
export const FORMATTERS_ID_ORIGIN_SUFFIX = 'formatters';
|
||||
export const SOURCE_FORMATTERS_ID_ORIGIN = `${SOURCE_DATA_ID_ORIGIN}_${FORMATTERS_ID_ORIGIN_SUFFIX}`;
|
||||
|
||||
export const GEOJSON_FILE = 'GEOJSON_FILE';
|
||||
|
||||
export const MIN_ZOOM = 0;
|
||||
export const MAX_ZOOM = 24;
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ import { getDefaultDynamicProperties } from './styles/vector/vector_style_defaul
|
|||
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,
|
||||
ES_GEO_GRID,
|
||||
LAYER_TYPE,
|
||||
AGG_TYPE,
|
||||
RENDER_AS,
|
||||
|
@ -180,7 +180,11 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer {
|
|||
const sourceDataRequest = this.getSourceDataRequest();
|
||||
if (sourceDataRequest) {
|
||||
const requestMeta = sourceDataRequest.getMeta();
|
||||
if (requestMeta && requestMeta.sourceType && requestMeta.sourceType === ES_GEO_GRID) {
|
||||
if (
|
||||
requestMeta &&
|
||||
requestMeta.sourceType &&
|
||||
requestMeta.sourceType === SOURCE_TYPES.ES_GEO_GRID
|
||||
) {
|
||||
isClustered = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import { AbstractVectorSource } from '../vector_source';
|
|||
import React from 'react';
|
||||
import {
|
||||
ES_GEO_FIELD_TYPE,
|
||||
GEOJSON_FILE,
|
||||
SOURCE_TYPES,
|
||||
DEFAULT_MAX_RESULT_WINDOW,
|
||||
SCALING_TYPES,
|
||||
} from '../../../../common/constants';
|
||||
|
@ -19,7 +19,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { registerSource } from '../source_registry';
|
||||
|
||||
export class GeojsonFileSource extends AbstractVectorSource {
|
||||
static type = GEOJSON_FILE;
|
||||
static type = SOURCE_TYPES.GEOJSON_FILE;
|
||||
|
||||
static isIndexingSource = true;
|
||||
|
||||
|
@ -130,7 +130,7 @@ const previewGeojsonFile = (onPreviewSource, inspectorAdapters) => {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: GeojsonFileSource,
|
||||
type: GEOJSON_FILE,
|
||||
type: SOURCE_TYPES.GEOJSON_FILE,
|
||||
});
|
||||
|
||||
export const uploadLayerWizardConfig = {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { AbstractVectorSource } from '../vector_source';
|
||||
import { VECTOR_SHAPE_TYPES } from '../vector_feature_types';
|
||||
import React from 'react';
|
||||
import { EMS_FILE, FIELD_ORIGIN } from '../../../../common/constants';
|
||||
import { SOURCE_TYPES, FIELD_ORIGIN } from '../../../../common/constants';
|
||||
import { getEMSClient } from '../../../meta';
|
||||
import { EMSFileCreateSourceEditor } from './create_source_editor';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
@ -21,7 +21,7 @@ const sourceTitle = i18n.translate('xpack.maps.source.emsFileTitle', {
|
|||
});
|
||||
|
||||
export class EMSFileSource extends AbstractVectorSource {
|
||||
static type = EMS_FILE;
|
||||
static type = SOURCE_TYPES.EMS_FILE;
|
||||
|
||||
static createDescriptor({ id, tooltipProperties = [] }) {
|
||||
return {
|
||||
|
@ -159,7 +159,7 @@ export class EMSFileSource extends AbstractVectorSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: EMSFileSource,
|
||||
type: EMS_FILE,
|
||||
type: SOURCE_TYPES.EMS_FILE,
|
||||
});
|
||||
|
||||
export const emsBoundariesLayerWizardConfig = {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { TileServiceSelect } from './tile_service_select';
|
|||
import { UpdateSourceEditor } from './update_source_editor';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { getDataSourceLabel } from '../../../../common/i18n_getters';
|
||||
import { EMS_TMS } from '../../../../common/constants';
|
||||
import { SOURCE_TYPES } from '../../../../common/constants';
|
||||
import { getInjectedVarFunc, getUiSettings } from '../../../kibana_services';
|
||||
import { registerSource } from '../source_registry';
|
||||
|
||||
|
@ -23,7 +23,7 @@ const sourceTitle = i18n.translate('xpack.maps.source.emsTileTitle', {
|
|||
});
|
||||
|
||||
export class EMSTMSSource extends AbstractTMSSource {
|
||||
static type = EMS_TMS;
|
||||
static type = SOURCE_TYPES.EMS_TMS;
|
||||
|
||||
static createDescriptor(sourceConfig) {
|
||||
return {
|
||||
|
@ -148,7 +148,7 @@ export class EMSTMSSource extends AbstractTMSSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: EMSTMSSource,
|
||||
type: EMS_TMS,
|
||||
type: SOURCE_TYPES.EMS_TMS,
|
||||
});
|
||||
|
||||
export const emsBaseMapLayerWizardConfig = {
|
||||
|
|
|
@ -17,8 +17,8 @@ import { COLOR_GRADIENTS } from '../../styles/color_utils';
|
|||
import { CreateSourceEditor } from './create_source_editor';
|
||||
import { UpdateSourceEditor } from './update_source_editor';
|
||||
import {
|
||||
SOURCE_TYPES,
|
||||
DEFAULT_MAX_BUCKETS_LIMIT,
|
||||
ES_GEO_GRID,
|
||||
COUNT_PROP_NAME,
|
||||
COLOR_MAP_TYPE,
|
||||
RENDER_AS,
|
||||
|
@ -45,7 +45,7 @@ const heatmapTitle = i18n.translate('xpack.maps.source.esGridHeatmapTitle', {
|
|||
});
|
||||
|
||||
export class ESGeoGridSource extends AbstractESAggSource {
|
||||
static type = ES_GEO_GRID;
|
||||
static type = SOURCE_TYPES.ES_GEO_GRID;
|
||||
|
||||
static createDescriptor({ indexPatternId, geoField, requestType, resolution }) {
|
||||
return {
|
||||
|
@ -311,7 +311,7 @@ export class ESGeoGridSource extends AbstractESAggSource {
|
|||
},
|
||||
meta: {
|
||||
areResultsTrimmed: false,
|
||||
sourceType: ES_GEO_GRID,
|
||||
sourceType: SOURCE_TYPES.ES_GEO_GRID,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ export class ESGeoGridSource extends AbstractESAggSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: ESGeoGridSource,
|
||||
type: ES_GEO_GRID,
|
||||
type: SOURCE_TYPES.ES_GEO_GRID,
|
||||
});
|
||||
|
||||
export const clustersLayerWizardConfig = {
|
||||
|
|
|
@ -7,7 +7,7 @@ jest.mock('../../../kibana_services', () => {});
|
|||
jest.mock('ui/new_platform');
|
||||
|
||||
import { ESGeoGridSource } from './es_geo_grid_source';
|
||||
import { ES_GEO_GRID, GRID_RESOLUTION, RENDER_AS } from '../../../../common/constants';
|
||||
import { GRID_RESOLUTION, RENDER_AS, SOURCE_TYPES } from '../../../../common/constants';
|
||||
|
||||
describe('ESGeoGridSource', () => {
|
||||
const geogridSource = new ESGeoGridSource(
|
||||
|
@ -17,7 +17,7 @@ describe('ESGeoGridSource', () => {
|
|||
geoField: 'bar',
|
||||
metrics: [],
|
||||
resolution: GRID_RESOLUTION.COARSE,
|
||||
type: ES_GEO_GRID,
|
||||
type: SOURCE_TYPES.ES_GEO_GRID,
|
||||
requestType: RENDER_AS.HEATMAP,
|
||||
},
|
||||
{}
|
||||
|
|
|
@ -16,7 +16,7 @@ import { getDefaultDynamicProperties } from '../../styles/vector/vector_style_de
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import {
|
||||
FIELD_ORIGIN,
|
||||
ES_PEW_PEW,
|
||||
SOURCE_TYPES,
|
||||
COUNT_PROP_NAME,
|
||||
VECTOR_STYLES,
|
||||
} from '../../../../common/constants';
|
||||
|
@ -35,7 +35,7 @@ const sourceTitle = i18n.translate('xpack.maps.source.pewPewTitle', {
|
|||
});
|
||||
|
||||
export class ESPewPewSource extends AbstractESAggSource {
|
||||
static type = ES_PEW_PEW;
|
||||
static type = SOURCE_TYPES.ES_PEW_PEW;
|
||||
|
||||
static createDescriptor({ indexPatternId, sourceGeoField, destGeoField }) {
|
||||
return {
|
||||
|
@ -232,7 +232,7 @@ export class ESPewPewSource extends AbstractESAggSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: ESPewPewSource,
|
||||
type: ES_PEW_PEW,
|
||||
type: SOURCE_TYPES.ES_PEW_PEW,
|
||||
});
|
||||
|
||||
export const point2PointLayerWizardConfig = {
|
||||
|
|
|
@ -17,7 +17,7 @@ import { hitsToGeoJson } from '../../../elasticsearch_geo_utils';
|
|||
import { CreateSourceEditor } from './create_source_editor';
|
||||
import { UpdateSourceEditor } from './update_source_editor';
|
||||
import {
|
||||
ES_SEARCH,
|
||||
SOURCE_TYPES,
|
||||
ES_GEO_FIELD_TYPE,
|
||||
DEFAULT_MAX_BUCKETS_LIMIT,
|
||||
SORT_ORDER,
|
||||
|
@ -69,7 +69,7 @@ function getDocValueAndSourceFields(indexPattern, fieldNames) {
|
|||
}
|
||||
|
||||
export class ESSearchSource extends AbstractESSource {
|
||||
static type = ES_SEARCH;
|
||||
static type = SOURCE_TYPES.ES_SEARCH;
|
||||
|
||||
constructor(descriptor, inspectorAdapters) {
|
||||
super(
|
||||
|
@ -404,7 +404,7 @@ export class ESSearchSource extends AbstractESSource {
|
|||
|
||||
return {
|
||||
data: featureCollection,
|
||||
meta: { ...meta, sourceType: ES_SEARCH },
|
||||
meta: { ...meta, sourceType: SOURCE_TYPES.ES_SEARCH },
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,7 @@ export class ESSearchSource extends AbstractESSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: ESSearchSource,
|
||||
type: ES_SEARCH,
|
||||
type: SOURCE_TYPES.ES_SEARCH,
|
||||
});
|
||||
|
||||
export const esDocumentsLayerWizardConfig = {
|
||||
|
|
|
@ -8,11 +8,11 @@ jest.mock('../../../kibana_services');
|
|||
|
||||
import { ESSearchSource } from './es_search_source';
|
||||
import { VectorLayer } from '../../vector_layer';
|
||||
import { ES_SEARCH, SCALING_TYPES } from '../../../../common/constants';
|
||||
import { SCALING_TYPES, SOURCE_TYPES } from '../../../../common/constants';
|
||||
import { ESSearchSourceDescriptor } from '../../../../common/descriptor_types';
|
||||
|
||||
const descriptor: ESSearchSourceDescriptor = {
|
||||
type: ES_SEARCH,
|
||||
type: SOURCE_TYPES.ES_SEARCH,
|
||||
id: '1234',
|
||||
indexPatternId: 'myIndexPattern',
|
||||
geoField: 'myLocation',
|
||||
|
|
|
@ -10,7 +10,7 @@ import { CreateSourceEditor } from './create_source_editor';
|
|||
import { getKibanaRegionList } from '../../../meta';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { getDataSourceLabel } from '../../../../common/i18n_getters';
|
||||
import { FIELD_ORIGIN, REGIONMAP_FILE } from '../../../../common/constants';
|
||||
import { FIELD_ORIGIN, SOURCE_TYPES } from '../../../../common/constants';
|
||||
import { KibanaRegionField } from '../../fields/kibana_region_field';
|
||||
import { registerSource } from '../source_registry';
|
||||
|
||||
|
@ -19,7 +19,7 @@ const sourceTitle = i18n.translate('xpack.maps.source.kbnRegionMapTitle', {
|
|||
});
|
||||
|
||||
export class KibanaRegionmapSource extends AbstractVectorSource {
|
||||
static type = REGIONMAP_FILE;
|
||||
static type = SOURCE_TYPES.REGIONMAP_FILE;
|
||||
|
||||
static createDescriptor({ name }) {
|
||||
return {
|
||||
|
@ -99,7 +99,7 @@ export class KibanaRegionmapSource extends AbstractVectorSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: KibanaRegionmapSource,
|
||||
type: REGIONMAP_FILE,
|
||||
type: SOURCE_TYPES.REGIONMAP_FILE,
|
||||
});
|
||||
|
||||
export const kibanaRegionMapLayerWizardConfig = {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { getKibanaTileMap } from '../../../meta';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { getDataSourceLabel } from '../../../../common/i18n_getters';
|
||||
import _ from 'lodash';
|
||||
import { KIBANA_TILEMAP } from '../../../../common/constants';
|
||||
import { SOURCE_TYPES } from '../../../../common/constants';
|
||||
import { registerSource } from '../source_registry';
|
||||
|
||||
const sourceTitle = i18n.translate('xpack.maps.source.kbnTMSTitle', {
|
||||
|
@ -19,7 +19,7 @@ const sourceTitle = i18n.translate('xpack.maps.source.kbnTMSTitle', {
|
|||
});
|
||||
|
||||
export class KibanaTilemapSource extends AbstractTMSSource {
|
||||
static type = KIBANA_TILEMAP;
|
||||
static type = SOURCE_TYPES.KIBANA_TILEMAP;
|
||||
|
||||
static createDescriptor() {
|
||||
return {
|
||||
|
@ -86,7 +86,7 @@ export class KibanaTilemapSource extends AbstractTMSSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: KibanaTilemapSource,
|
||||
type: KIBANA_TILEMAP,
|
||||
type: SOURCE_TYPES.KIBANA_TILEMAP,
|
||||
});
|
||||
|
||||
export const kibanaBasemapLayerWizardConfig = {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { WMSCreateSourceEditor } from './wms_create_source_editor';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters';
|
||||
import { WmsClient } from './wms_client';
|
||||
import { WMS } from '../../../../common/constants';
|
||||
import { SOURCE_TYPES } from '../../../../common/constants';
|
||||
import { registerSource } from '../source_registry';
|
||||
|
||||
const sourceTitle = i18n.translate('xpack.maps.source.wmsTitle', {
|
||||
|
@ -20,7 +20,7 @@ const sourceTitle = i18n.translate('xpack.maps.source.wmsTitle', {
|
|||
});
|
||||
|
||||
export class WMSSource extends AbstractTMSSource {
|
||||
static type = WMS;
|
||||
static type = SOURCE_TYPES.WMS;
|
||||
|
||||
static createDescriptor({ serviceUrl, layers, styles, attributionText, attributionUrl }) {
|
||||
return {
|
||||
|
@ -92,7 +92,7 @@ export class WMSSource extends AbstractTMSSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: WMSSource,
|
||||
type: WMS,
|
||||
type: SOURCE_TYPES.WMS,
|
||||
});
|
||||
|
||||
export const wmsLayerWizardConfig = {
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
import { XYZTMSSource } from './xyz_tms_source';
|
||||
import { ILayer } from '../../layer';
|
||||
import { TileLayer } from '../../tile_layer';
|
||||
import { EMS_XYZ } from '../../../../common/constants';
|
||||
import { SOURCE_TYPES } from '../../../../common/constants';
|
||||
import { XYZTMSSourceDescriptor } from '../../../../common/descriptor_types';
|
||||
|
||||
const descriptor: XYZTMSSourceDescriptor = {
|
||||
type: EMS_XYZ,
|
||||
type: SOURCE_TYPES.EMS_XYZ,
|
||||
urlTemplate: 'https://example.com/{x}/{y}/{z}.png',
|
||||
id: 'foobar',
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { TileLayer } from '../../tile_layer';
|
||||
import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters';
|
||||
import { EMS_XYZ } from '../../../../common/constants';
|
||||
import { SOURCE_TYPES } from '../../../../common/constants';
|
||||
import { registerSource } from '../source_registry';
|
||||
import { AbstractTMSSource } from '../tms_source';
|
||||
import { LayerDescriptor, XYZTMSSourceDescriptor } from '../../../../common/descriptor_types';
|
||||
|
@ -19,7 +19,7 @@ export const sourceTitle = i18n.translate('xpack.maps.source.ems_xyzTitle', {
|
|||
});
|
||||
|
||||
export class XYZTMSSource extends AbstractTMSSource {
|
||||
static type = EMS_XYZ;
|
||||
static type = SOURCE_TYPES.EMS_XYZ;
|
||||
|
||||
readonly _descriptor: XYZTMSSourceDescriptor;
|
||||
|
||||
|
@ -83,5 +83,5 @@ export class XYZTMSSource extends AbstractTMSSource {
|
|||
|
||||
registerSource({
|
||||
ConstructorFunction: XYZTMSSource,
|
||||
type: EMS_XYZ,
|
||||
type: SOURCE_TYPES.EMS_XYZ,
|
||||
});
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
*/
|
||||
|
||||
import { TileLayer } from './tile_layer';
|
||||
import { EMS_XYZ } from '../../common/constants';
|
||||
import { SOURCE_TYPES } from '../../common/constants';
|
||||
import { XYZTMSSourceDescriptor } from '../../common/descriptor_types';
|
||||
import { ITMSSource, AbstractTMSSource } from './sources/tms_source';
|
||||
import { ILayer } from './layer';
|
||||
|
||||
const sourceDescriptor: XYZTMSSourceDescriptor = {
|
||||
type: EMS_XYZ,
|
||||
type: SOURCE_TYPES.EMS_XYZ,
|
||||
urlTemplate: 'https://example.com/{x}/{y}/{z}.png',
|
||||
id: 'foobar',
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue