mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
This commit is contained in:
parent
252a09971f
commit
e16f98bd06
10 changed files with 73 additions and 101 deletions
|
@ -63,7 +63,7 @@ describe('Saved object does not have layer list', () => {
|
|||
const layers = getInitialLayers(null);
|
||||
expect(layers).toEqual([{
|
||||
"alpha": 1,
|
||||
"dataRequests": [],
|
||||
"__dataRequests": [],
|
||||
"id": layers[0].id,
|
||||
"label": null,
|
||||
"maxZoom": 24,
|
||||
|
@ -93,7 +93,7 @@ describe('Saved object does not have layer list', () => {
|
|||
const layers = getInitialLayers(null);
|
||||
expect(layers).toEqual([{
|
||||
"alpha": 1,
|
||||
dataRequests: [],
|
||||
__dataRequests: [],
|
||||
id: layers[0].id,
|
||||
label: null,
|
||||
maxZoom: 24,
|
||||
|
@ -122,7 +122,7 @@ describe('Saved object does not have layer list', () => {
|
|||
const layers = getInitialLayers(null);
|
||||
expect(layers).toEqual([{
|
||||
"alpha": 1,
|
||||
dataRequests: [],
|
||||
__dataRequests: [],
|
||||
id: layers[0].id,
|
||||
label: null,
|
||||
maxZoom: 24,
|
||||
|
|
|
@ -67,12 +67,7 @@ module.factory('SavedGisMap', function (Private) {
|
|||
|
||||
SavedGisMap.prototype.syncWithStore = function (state) {
|
||||
const layerList = getLayerListRaw(state);
|
||||
// Layer list from store contains requested data.
|
||||
// We do not want to store this in the saved object so it is getting removed
|
||||
const layerListConfigOnly = layerList.map(layer => {
|
||||
delete layer.dataRequests;
|
||||
return layer;
|
||||
});
|
||||
const layerListConfigOnly = copyPersistentState(layerList);
|
||||
this.layerListJSON = JSON.stringify(layerListConfigOnly);
|
||||
|
||||
this.mapStateJSON = JSON.stringify({
|
||||
|
@ -90,3 +85,17 @@ module.factory('SavedGisMap', function (Private) {
|
|||
|
||||
return SavedGisMap;
|
||||
});
|
||||
|
||||
|
||||
function copyPersistentState(input) {
|
||||
if (typeof input !== 'object' && input !== null) {//primitive
|
||||
return input;
|
||||
}
|
||||
const copyInput = Array.isArray(input) ? [] : {};
|
||||
for(const key in input) {
|
||||
if (!key.startsWith('__')) {
|
||||
copyInput[key] = copyPersistentState(input[key]);
|
||||
}
|
||||
}
|
||||
return copyInput;
|
||||
}
|
||||
|
|
|
@ -209,11 +209,7 @@ export class MBMapContainer extends React.Component {
|
|||
|
||||
removeOrphanedSourcesAndLayers(this._mbMap, layerList);
|
||||
layerList.forEach(layer => {
|
||||
if (!layer.hasErrors()) {
|
||||
Promise.resolve(layer.syncLayerWithMB(this._mbMap))
|
||||
.catch(({ message }) =>
|
||||
this.props.setLayerErrorStatus(layer.getId(), message));
|
||||
}
|
||||
layer.syncLayerWithMB(this._mbMap);
|
||||
});
|
||||
syncLayerOrder(this._mbMap, layerList);
|
||||
};
|
||||
|
|
|
@ -17,8 +17,8 @@ export class AbstractLayer {
|
|||
this._descriptor = AbstractLayer.createDescriptor(layerDescriptor);
|
||||
this._source = source;
|
||||
this._style = style;
|
||||
if (this._descriptor.dataRequests) {
|
||||
this._dataRequests = this._descriptor.dataRequests.map(dataRequest => new DataRequest(dataRequest));
|
||||
if (this._descriptor.__dataRequests) {
|
||||
this._dataRequests = this._descriptor.__dataRequests.map(dataRequest => new DataRequest(dataRequest));
|
||||
} else {
|
||||
this._dataRequests = [];
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export class AbstractLayer {
|
|||
static createDescriptor(options = {}) {
|
||||
const layerDescriptor = { ...options };
|
||||
|
||||
layerDescriptor.dataRequests = _.get(options, 'dataRequests', []);
|
||||
layerDescriptor.__dataRequests = _.get(options, '__dataRequests', []);
|
||||
layerDescriptor.id = _.get(options, 'id', Math.random().toString(36).substr(2, 5));
|
||||
layerDescriptor.label = options.label && options.label.length > 0 ? options.label : null;
|
||||
layerDescriptor.minZoom = _.get(options, 'minZoom', 0);
|
||||
|
@ -150,11 +150,11 @@ export class AbstractLayer {
|
|||
}
|
||||
|
||||
hasErrors() {
|
||||
return _.get(this._descriptor, 'isInErrorState', false);
|
||||
return _.get(this._descriptor, '__isInErrorState', false);
|
||||
}
|
||||
|
||||
getErrors() {
|
||||
return this.hasErrors() ? this._descriptor.errorMessage : '';
|
||||
return this.hasErrors() ? this._descriptor.__errorMessage : '';
|
||||
}
|
||||
|
||||
toLayerDescriptor() {
|
||||
|
@ -165,6 +165,10 @@ export class AbstractLayer {
|
|||
//no-op by default
|
||||
}
|
||||
|
||||
syncLayerWithMb() {
|
||||
//no-op by default
|
||||
}
|
||||
|
||||
updateDueToExtent(source, meta = {}, dataFilters = {}) {
|
||||
const extentAware = source.isFilterByMapBounds();
|
||||
if (!extentAware) {
|
||||
|
@ -224,5 +228,9 @@ export class AbstractLayer {
|
|||
return [];
|
||||
}
|
||||
|
||||
async getOrdinalFields() {
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,6 @@ import React from 'react';
|
|||
import { EuiIcon } from '@elastic/eui';
|
||||
import { TileStyle } from '../layers/styles/tile_style';
|
||||
|
||||
const TMS_LOAD_TIMEOUT = 32000;
|
||||
|
||||
export class TileLayer extends AbstractLayer {
|
||||
|
||||
static type = "TILE";
|
||||
|
@ -32,38 +30,6 @@ export class TileLayer extends AbstractLayer {
|
|||
return tileLayerDescriptor;
|
||||
}
|
||||
|
||||
_tileLoadErrorTracker(map, url) {
|
||||
let tileLoad;
|
||||
map.on('dataloading', ({ tile }) => {
|
||||
if (tile && tile.request) {
|
||||
// If at least one tile loads, endpoint/resource is valid
|
||||
tile.request.onloadend = ({ loaded }) => {
|
||||
if (loaded) {
|
||||
tileLoad = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let tileLoadTimer = null;
|
||||
|
||||
const clearChecks = () => {
|
||||
clearTimeout(tileLoadTimer);
|
||||
map.off('dataloading');
|
||||
};
|
||||
|
||||
tileLoadTimer = setTimeout(() => {
|
||||
if (!tileLoad) {
|
||||
reject(new Error(`Tiles from "${url}" could not be loaded`));
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
clearChecks();
|
||||
}, TMS_LOAD_TIMEOUT);
|
||||
});
|
||||
}
|
||||
|
||||
async syncData({ startLoading, stopLoading, onLoadError, dataFilters }) {
|
||||
if (!this.isVisible() || !this.showAtZoomLevel(dataFilters.zoom)) {
|
||||
return;
|
||||
|
@ -79,41 +45,36 @@ export class TileLayer extends AbstractLayer {
|
|||
}
|
||||
}
|
||||
|
||||
async syncLayerWithMB(mbMap) {
|
||||
syncLayerWithMB(mbMap) {
|
||||
|
||||
const source = mbMap.getSource(this.getId());
|
||||
const mbLayerId = this.getId() + '_raster';
|
||||
|
||||
if (source) {
|
||||
// If source exists, just sync style
|
||||
this._setTileLayerProperties(mbMap, mbLayerId);
|
||||
return;
|
||||
if (!source) {
|
||||
const sourceDataRequest = this.getSourceDataRequest();
|
||||
const url = sourceDataRequest.getData();
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
const sourceId = this.getId();
|
||||
mbMap.addSource(sourceId, {
|
||||
type: 'raster',
|
||||
tiles: [url],
|
||||
tileSize: 256,
|
||||
scheme: 'xyz',
|
||||
});
|
||||
|
||||
mbMap.addLayer({
|
||||
id: mbLayerId,
|
||||
type: 'raster',
|
||||
source: sourceId,
|
||||
minzoom: this._descriptor.minZoom,
|
||||
maxzoom: this._descriptor.maxZoom,
|
||||
});
|
||||
}
|
||||
|
||||
const sourceDataRquest = this.getSourceDataRequest();
|
||||
const url = sourceDataRquest.getData();
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
const sourceId = this.getId();
|
||||
mbMap.addSource(sourceId, {
|
||||
type: 'raster',
|
||||
tiles: [url],
|
||||
tileSize: 256,
|
||||
scheme: 'xyz',
|
||||
});
|
||||
|
||||
mbMap.addLayer({
|
||||
id: mbLayerId,
|
||||
type: 'raster',
|
||||
source: sourceId,
|
||||
minzoom: this._descriptor.minZoom,
|
||||
maxzoom: this._descriptor.maxZoom,
|
||||
});
|
||||
this._setTileLayerProperties(mbMap, mbLayerId);
|
||||
|
||||
await this._tileLoadErrorTracker(mbMap, url);
|
||||
}
|
||||
|
||||
_setTileLayerProperties(mbMap, mbLayerId) {
|
||||
|
|
|
@ -95,8 +95,6 @@ const INITIAL_STATE = {
|
|||
};
|
||||
|
||||
export function map(state = INITIAL_STATE, action) {
|
||||
window._state = state;
|
||||
//todo throw actions with actual objects so this doesn't get so cluttered
|
||||
switch (action.type) {
|
||||
case SET_MOUSE_COORDINATES:
|
||||
return {
|
||||
|
@ -251,19 +249,19 @@ export function map(state = INITIAL_STATE, action) {
|
|||
const styleLayerId = action.layerId;
|
||||
const styleLayerIdx = getLayerIndex(state.layerList, styleLayerId);
|
||||
const layerStyle = state.layerList[styleLayerIdx].style;
|
||||
const layerPrevStyle = layerStyle.previousStyle || layerStyle;
|
||||
const layerPrevStyle = layerStyle.__previousStyle || layerStyle;
|
||||
return updateLayerInList(state, styleLayerId, 'style',
|
||||
{ ...action.style, previousStyle: { ...layerPrevStyle } });
|
||||
{ ...action.style, __previousStyle: { ...layerPrevStyle } });
|
||||
case PROMOTE_TEMPORARY_STYLES:
|
||||
const stylePromoteIdx = getLayerIndex(state.layerList, state.selectedLayerId);
|
||||
const styleToSet = {
|
||||
...state.layerList[stylePromoteIdx].style,
|
||||
previousStyle: null
|
||||
__previousStyle: null
|
||||
};
|
||||
return updateLayerInList(state, state.selectedLayerId, 'style', styleToSet);
|
||||
case CLEAR_TEMPORARY_STYLES:
|
||||
const styleClearIdx = getLayerIndex(state.layerList, state.selectedLayerId);
|
||||
const prevStyleToLoad = state.layerList[styleClearIdx].style.previousStyle || state.layerList[styleClearIdx].style || {};
|
||||
const prevStyleToLoad = state.layerList[styleClearIdx].style.__previousStyle || state.layerList[styleClearIdx].style || {};
|
||||
return updateLayerInList(state, state.selectedLayerId, 'style', prevStyleToLoad);
|
||||
default:
|
||||
return state;
|
||||
|
@ -274,18 +272,18 @@ function setErrorStatus(state, { layerId, errorMessage }) {
|
|||
const tmsErrorLayer = state.layerList.find(({ id }) => id === layerId);
|
||||
return tmsErrorLayer
|
||||
? updateLayerInList(
|
||||
updateLayerInList(state, tmsErrorLayer.id, 'isInErrorState', true),
|
||||
tmsErrorLayer.id, 'errorMessage', errorMessage)
|
||||
updateLayerInList(state, tmsErrorLayer.id, '__isInErrorState', true),
|
||||
tmsErrorLayer.id, '__errorMessage', errorMessage)
|
||||
: state;
|
||||
}
|
||||
|
||||
function findDataRequest(layerDescriptor, dataRequestAction) {
|
||||
|
||||
if (!layerDescriptor.dataRequests) {
|
||||
if (!layerDescriptor.__dataRequests) {
|
||||
return;
|
||||
}
|
||||
|
||||
return layerDescriptor.dataRequests.find(dataRequest => {
|
||||
return layerDescriptor.__dataRequests.find(dataRequest => {
|
||||
return dataRequest.dataId === dataRequestAction.dataId;
|
||||
});
|
||||
}
|
||||
|
@ -299,9 +297,9 @@ function updateWithDataRequest(state, action) {
|
|||
dataRequest = {
|
||||
dataId: action.dataId
|
||||
};
|
||||
layerRequestingData.dataRequests = [
|
||||
...(layerRequestingData.dataRequests
|
||||
? layerRequestingData.dataRequests : []), dataRequest ];
|
||||
layerRequestingData.__dataRequests = [
|
||||
...(layerRequestingData.__dataRequests
|
||||
? layerRequestingData.__dataRequests : []), dataRequest ];
|
||||
}
|
||||
dataRequest.dataMetaAtStart = action.meta;
|
||||
dataRequest.dataRequestToken = action.requestToken;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"title":"Italy Map",
|
||||
"description":"",
|
||||
"mapStateJSON":"{\"zoom\":4.82,\"center\":{\"lon\":11.41545,\"lat\":42.0865},\"timeFilters\":{\"from\":\"now-15w\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":0},\"query\":{\"language\":\"lucene\",\"query\":\"\"}}",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"temporary\":false,\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{},\"previousStyle\":null},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"italy_provinces\"},\"temporary\":false,\"id\":\"0oye8\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#0c1f70\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"},{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"053fe296-f5ae-4cb0-9e73-a5752cb9ba74\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"resolution\":\"COARSE\"},\"temporary\":false,\"id\":\"1gx22\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"minSize\":4,\"maxSize\":32}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"}]",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"temporary\":false,\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"italy_provinces\"},\"temporary\":false,\"id\":\"0oye8\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#0c1f70\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true},\"type\":\"VECTOR\"},{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"053fe296-f5ae-4cb0-9e73-a5752cb9ba74\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"resolution\":\"COARSE\"},\"temporary\":false,\"id\":\"1gx22\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"minSize\":4,\"maxSize\":32}}},\"temporary\":true},\"type\":\"VECTOR\"}]",
|
||||
"uiStateJSON":"{}",
|
||||
"bounds":{
|
||||
"type":"polygon",
|
||||
|
@ -53,7 +53,7 @@
|
|||
"title":"France Map",
|
||||
"description":"",
|
||||
"mapStateJSON":"{\"zoom\":3.43,\"center\":{\"lon\":-16.30411,\"lat\":42.88411},\"timeFilters\":{\"from\":\"now-15w\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"lucene\"}}",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"temporary\":false,\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{},\"previousStyle\":null},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"france_departments\"},\"temporary\":false,\"id\":\"65xbw\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.25,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#19c1e6\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"},{\"sourceDescriptor\":{\"id\":\"240125db-e612-4001-b853-50107e55d984\",\"type\":\"ES_SEARCH\",\"indexPatternId\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"geoField\":\"geoip.location\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[]},\"temporary\":false,\"id\":\"mdae9\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#1ce619\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"}]",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"temporary\":false,\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"france_departments\"},\"temporary\":false,\"id\":\"65xbw\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.25,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#19c1e6\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true},\"type\":\"VECTOR\"},{\"sourceDescriptor\":{\"id\":\"240125db-e612-4001-b853-50107e55d984\",\"type\":\"ES_SEARCH\",\"indexPatternId\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"geoField\":\"geoip.location\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[]},\"temporary\":false,\"id\":\"mdae9\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#1ce619\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true},\"type\":\"VECTOR\"}]",
|
||||
"uiStateJSON":"{}",
|
||||
"bounds":{
|
||||
"type":"polygon",
|
||||
|
@ -96,7 +96,7 @@
|
|||
"title":"Canada Map",
|
||||
"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\":\"EMS_TMS\",\"id\":\"road_map\"},\"temporary\":false,\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{},\"previousStyle\":null},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"canada_provinces\"},\"temporary\":false,\"id\":\"kt086\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#60895e\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"}]",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"temporary\":false,\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"canada_provinces\"},\"temporary\":false,\"id\":\"kt086\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#60895e\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true},\"type\":\"VECTOR\"}]",
|
||||
"uiStateJSON":"{}",
|
||||
"bounds":{
|
||||
"type":"polygon",
|
||||
|
@ -133,4 +133,4 @@
|
|||
"version":1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -8,7 +8,7 @@
|
|||
"title":"[Flights] Origin and Destination Flight Time",
|
||||
"description":"",
|
||||
"mapStateJSON":"{\"zoom\":3.14,\"center\":{\"lon\":-89.58746,\"lat\":38.38637},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":0},\"query\":{\"query\":\"\",\"language\":\"kuery\"}}",
|
||||
"layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"jzppx\",\"label\":\"Flights\",\"minZoom\":9,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"040e0f25-9687-4569-a1e0-76f1a108da56\",\"type\":\"ES_SEARCH\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"Carrier\",\"DestCityName\",\"DestCountry\",\"OriginCityName\",\"OriginCountry\",\"FlightDelayMin\",\"FlightTimeMin\",\"DistanceMiles\",\"AvgTicketPrice\",\"FlightDelay\"]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"FlightTimeMin\",\"name\":\"FlightTimeMin\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"DistanceMiles\",\"name\":\"DistanceMiles\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":32}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"},{\"id\":\"y4jsz\",\"label\":\"Flight Origin Location\",\"minZoom\":0,\"maxZoom\":9,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"fe893f84-388e-4865-8df4-650748533a77\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"OriginLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\"},{\"type\":\"avg\",\"field\":\"FlightTimeMin\"}]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Blues\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#110081\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"avg of FlightTimeMin\",\"name\":\"avg_of_FlightTimeMin\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":32}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"},{\"id\":\"x8xpo\",\"label\":\"Flight Destination Location\",\"minZoom\":0,\"maxZoom\":9,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"60a7346a-8c5f-4c03-b7d1-e8b36e847551\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\"},{\"type\":\"avg\",\"field\":\"FlightDelayMin\"}]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Reds\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#af0303\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"avg of FlightDelayMin\",\"name\":\"avg_of_FlightDelayMin\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":32}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"}]",
|
||||
"layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"jzppx\",\"label\":\"Flights\",\"minZoom\":9,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"040e0f25-9687-4569-a1e0-76f1a108da56\",\"type\":\"ES_SEARCH\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"Carrier\",\"DestCityName\",\"DestCountry\",\"OriginCityName\",\"OriginCountry\",\"FlightDelayMin\",\"FlightTimeMin\",\"DistanceMiles\",\"AvgTicketPrice\",\"FlightDelay\"]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"FlightTimeMin\",\"name\":\"FlightTimeMin\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"DistanceMiles\",\"name\":\"DistanceMiles\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":32}}},\"temporary\":true},\"type\":\"VECTOR\"},{\"id\":\"y4jsz\",\"label\":\"Flight Origin Location\",\"minZoom\":0,\"maxZoom\":9,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"fe893f84-388e-4865-8df4-650748533a77\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"OriginLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\"},{\"type\":\"avg\",\"field\":\"FlightTimeMin\"}]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Blues\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#110081\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"avg of FlightTimeMin\",\"name\":\"avg_of_FlightTimeMin\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":32}}},\"temporary\":true},\"type\":\"VECTOR\"},{\"id\":\"x8xpo\",\"label\":\"Flight Destination Location\",\"minZoom\":0,\"maxZoom\":9,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"60a7346a-8c5f-4c03-b7d1-e8b36e847551\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\"},{\"type\":\"avg\",\"field\":\"FlightDelayMin\"}]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Reds\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#af0303\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"avg of FlightDelayMin\",\"name\":\"avg_of_FlightDelayMin\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":32}}},\"temporary\":true},\"type\":\"VECTOR\"}]",
|
||||
"uiStateJSON":"{\"isDarkMode\":false}",
|
||||
"bounds":{"type":"envelope","coordinates":[[-139.83779,56.64828],[-39.33713,14.04811]]}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"title":"[Logs] Total Requests and Bytes",
|
||||
"description":"",
|
||||
"mapStateJSON":"{\"zoom\":3.64,\"center\":{\"lon\":-88.92107,\"lat\":42.16337},\"timeFilters\":{\"from\":\"now-7d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":0},\"query\":{\"language\":\"kuery\",\"query\":\"\"}}",
|
||||
"layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"edh66\",\"label\":\"Total Requests by Country\",\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.5,\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"world_countries\"},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"count of kibana_sample_data_logs:geo.src\",\"name\":\"__kbnjoin__count_groupby_kibana_sample_data_logs.geo.src\",\"origin\":\"join\"},\"color\":\"Greys\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\",\"joins\":[{\"leftField\":\"iso2\",\"right\":{\"id\":\"673ff994-fc75-4c67-909b-69fcb0e1060e\",\"indexPatternId\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"indexPatternTitle\":\"kibana_sample_data_logs\",\"term\":\"geo.src\"}}]},{\"id\":\"gaxya\",\"label\":\"Actual Requests\",\"minZoom\":9,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"b7486535-171b-4d3b-bb2e-33c1a0a2854c\",\"type\":\"ES_SEARCH\",\"indexPatternId\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"geoField\":\"geo.coordinates\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"clientip\",\"timestamp\",\"host\",\"request\",\"response\",\"machine.os\",\"agent\",\"bytes\"]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#2200ff\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":2}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"bytes\",\"name\":\"bytes\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":23}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"},{\"id\":\"tfi3f\",\"label\":\"Total Requests and Bytes\",\"minZoom\":0,\"maxZoom\":9,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"8aaa65b5-a4e9-448b-9560-c98cb1c5ac5b\",\"indexPatternId\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"geoField\":\"geo.coordinates\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\"},{\"type\":\"sum\",\"field\":\"bytes\"}]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Blues\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#cccccc\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"sum of bytes\",\"name\":\"sum_of_bytes\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":25}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\"}]",
|
||||
"layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\",\"minZoom\":0,\"maxZoom\":24},{\"id\":\"edh66\",\"label\":\"Total Requests by Country\",\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.5,\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"world_countries\"},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"count of kibana_sample_data_logs:geo.src\",\"name\":\"__kbnjoin__count_groupby_kibana_sample_data_logs.geo.src\",\"origin\":\"join\"},\"color\":\"Greys\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}},\"temporary\":true},\"type\":\"VECTOR\",\"joins\":[{\"leftField\":\"iso2\",\"right\":{\"id\":\"673ff994-fc75-4c67-909b-69fcb0e1060e\",\"indexPatternId\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"indexPatternTitle\":\"kibana_sample_data_logs\",\"term\":\"geo.src\"}}]},{\"id\":\"gaxya\",\"label\":\"Actual Requests\",\"minZoom\":9,\"maxZoom\":24,\"alpha\":1,\"sourceDescriptor\":{\"id\":\"b7486535-171b-4d3b-bb2e-33c1a0a2854c\",\"type\":\"ES_SEARCH\",\"indexPatternId\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"geoField\":\"geo.coordinates\",\"limit\":2048,\"filterByMapBounds\":true,\"tooltipProperties\":[\"clientip\",\"timestamp\",\"host\",\"request\",\"response\",\"machine.os\",\"agent\",\"bytes\"]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#2200ff\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":2}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"bytes\",\"name\":\"bytes\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":23}}},\"temporary\":true},\"type\":\"VECTOR\"},{\"id\":\"tfi3f\",\"label\":\"Total Requests and Bytes\",\"minZoom\":0,\"maxZoom\":9,\"alpha\":1,\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"resolution\":\"COARSE\",\"id\":\"8aaa65b5-a4e9-448b-9560-c98cb1c5ac5b\",\"indexPatternId\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"geoField\":\"geo.coordinates\",\"requestType\":\"point\",\"metrics\":[{\"type\":\"count\"},{\"type\":\"sum\",\"field\":\"bytes\"}]},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Blues\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#cccccc\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"sum of bytes\",\"name\":\"sum_of_bytes\",\"origin\":\"source\"},\"minSize\":1,\"maxSize\":25}}},\"temporary\":true},\"type\":\"VECTOR\"}]",
|
||||
"uiStateJSON":"{\"isDarkMode\":false}",
|
||||
"bounds":{"type":"envelope","coordinates":[[-124.45342,54.91445],[-53.38872,26.21461]]}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue