mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Move layer add flow to the add layer panel * Remove layer add toast. It's pretty annoying in this new workflow and is planned to be removed/revised anyway * Add/remove layers without setting temp status * Dispatch save function on ws save and clear/remove transient layer * Lot of cleanup of temp refs. Add __ to transient layer ref * Activate layer property save button on style prop change * Review feedback * Await setting selected layer before opening flyout panel to prevent occasional undefined error * Review feedback * Review feedback * Review feedback * Remove style temp settings * Return null as fallback * Review feedback # Conflicts: # x-pack/plugins/maps/public/angular/get_initial_layers.test.js # x-pack/plugins/maps/public/angular/map_controller.js # x-pack/plugins/maps/public/components/layer_addpanel/index.js # x-pack/plugins/maps/public/components/layer_addpanel/view.js
This commit is contained in:
parent
4e30272e6a
commit
06a8f9c47b
17 changed files with 127 additions and 137 deletions
|
@ -12,17 +12,19 @@ import {
|
|||
getDataFilters,
|
||||
getSelectedLayerId,
|
||||
getMapReady,
|
||||
getWaitingForMapReadyLayerListRaw
|
||||
getWaitingForMapReadyLayerListRaw,
|
||||
getTransientLayerId,
|
||||
} from '../selectors/map_selectors';
|
||||
import { updateFlyout, FLYOUT_STATE } from '../store/ui';
|
||||
|
||||
export const SET_SELECTED_LAYER = 'SET_SELECTED_LAYER';
|
||||
export const SET_TRANSIENT_LAYER = 'SET_TRANSIENT_LAYER';
|
||||
export const UPDATE_LAYER_ORDER = 'UPDATE_LAYER_ORDER';
|
||||
export const ADD_LAYER = 'ADD_LAYER';
|
||||
export const SET_LAYER_ERROR_STATUS = 'SET_LAYER_ERROR_STATUS';
|
||||
export const ADD_WAITING_FOR_MAP_READY_LAYER = 'ADD_WAITING_FOR_MAP_READY_LAYER';
|
||||
export const CLEAR_WAITING_FOR_MAP_READY_LAYER_LIST = 'CLEAR_WAITING_FOR_MAP_READY_LAYER_LIST';
|
||||
export const REMOVE_LAYER = 'REMOVE_LAYER';
|
||||
export const PROMOTE_TEMPORARY_LAYERS = 'PROMOTE_TEMPORARY_LAYERS';
|
||||
export const TOGGLE_LAYER_VISIBLE = 'TOGGLE_LAYER_VISIBLE';
|
||||
export const MAP_EXTENT_CHANGED = 'MAP_EXTENT_CHANGED';
|
||||
export const MAP_READY = 'MAP_READY';
|
||||
|
@ -112,8 +114,6 @@ export function replaceLayerList(newLayerList) {
|
|||
|
||||
export function addLayer(layerDescriptor) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(clearTemporaryLayers());
|
||||
|
||||
const isMapReady = getMapReady(getState());
|
||||
if (!isMapReady) {
|
||||
dispatch({
|
||||
|
@ -165,7 +165,6 @@ export function toggleLayerVisible(layerId) {
|
|||
|
||||
export function setSelectedLayer(layerId) {
|
||||
return async (dispatch, getState) => {
|
||||
|
||||
const oldSelectedLayer = getSelectedLayerId(getState());
|
||||
if (oldSelectedLayer) {
|
||||
await dispatch(rollbackToTrackedLayerStateForSelectedLayer());
|
||||
|
@ -180,6 +179,31 @@ export function setSelectedLayer(layerId) {
|
|||
};
|
||||
}
|
||||
|
||||
export function removeTransientLayer() {
|
||||
return async (dispatch, getState) => {
|
||||
const transientLayerId = getTransientLayerId(getState());
|
||||
if (transientLayerId) {
|
||||
await dispatch(removeLayer(transientLayerId));
|
||||
await dispatch(setTransientLayer(null));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function setTransientLayer(layerId) {
|
||||
return {
|
||||
type: SET_TRANSIENT_LAYER,
|
||||
transientLayerId: layerId,
|
||||
};
|
||||
}
|
||||
|
||||
export function clearTransientLayerStateAndCloseFlyout() {
|
||||
return async dispatch => {
|
||||
await dispatch(updateFlyout(FLYOUT_STATE.NONE));
|
||||
await dispatch(setSelectedLayer(null));
|
||||
await dispatch(removeTransientLayer());
|
||||
};
|
||||
}
|
||||
|
||||
export function updateLayerOrder(newLayerOrder) {
|
||||
return {
|
||||
type: UPDATE_LAYER_ORDER,
|
||||
|
@ -187,22 +211,6 @@ export function updateLayerOrder(newLayerOrder) {
|
|||
};
|
||||
}
|
||||
|
||||
export function promoteTemporaryLayers() {
|
||||
return {
|
||||
type: PROMOTE_TEMPORARY_LAYERS
|
||||
};
|
||||
}
|
||||
|
||||
export function clearTemporaryLayers() {
|
||||
return (dispatch, getState) => {
|
||||
getLayerListRaw(getState()).forEach(({ temporary, id }) => {
|
||||
if (temporary) {
|
||||
dispatch(removeLayer(id));
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function mapReady() {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
|
@ -513,14 +521,13 @@ export function clearMissingStyleProperties(layerId) {
|
|||
};
|
||||
}
|
||||
|
||||
export function updateLayerStyle(layerId, styleDescriptor, temporary = true) {
|
||||
export function updateLayerStyle(layerId, styleDescriptor) {
|
||||
return (dispatch) => {
|
||||
dispatch({
|
||||
type: UPDATE_LAYER_STYLE,
|
||||
layerId,
|
||||
style: {
|
||||
...styleDescriptor,
|
||||
temporary
|
||||
...styleDescriptor
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -529,13 +536,13 @@ export function updateLayerStyle(layerId, styleDescriptor, temporary = true) {
|
|||
};
|
||||
}
|
||||
|
||||
export function updateLayerStyleForSelectedLayer(styleDescriptor, temporary = true) {
|
||||
export function updateLayerStyleForSelectedLayer(styleDescriptor) {
|
||||
return (dispatch, getState) => {
|
||||
const selectedLayerId = getSelectedLayerId(getState());
|
||||
if (!selectedLayerId) {
|
||||
return;
|
||||
}
|
||||
dispatch(updateLayerStyle(selectedLayerId, styleDescriptor, temporary));
|
||||
dispatch(updateLayerStyle(selectedLayerId, styleDescriptor));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -76,9 +76,8 @@ describe('Saved object does not have layer list', () => {
|
|||
"properties": {},
|
||||
"type": "TILE",
|
||||
},
|
||||
"temporary": false,
|
||||
"type": "TILE",
|
||||
"visible": true,
|
||||
'type': 'TILE',
|
||||
'visible': true,
|
||||
}]);
|
||||
});
|
||||
|
||||
|
@ -105,7 +104,6 @@ describe('Saved object does not have layer list', () => {
|
|||
properties: {},
|
||||
type: 'TILE',
|
||||
},
|
||||
temporary: false,
|
||||
type: 'TILE',
|
||||
visible: true,
|
||||
}]);
|
||||
|
@ -134,7 +132,6 @@ describe('Saved object does not have layer list', () => {
|
|||
properties: {},
|
||||
type: 'TILE',
|
||||
},
|
||||
temporary: false,
|
||||
type: 'TILE',
|
||||
visible: true,
|
||||
}]);
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
setGotoWithCenter,
|
||||
replaceLayerList,
|
||||
setQuery,
|
||||
clearTransientLayerStateAndCloseFlyout,
|
||||
} from '../actions/store_actions';
|
||||
import {
|
||||
enableFullScreen,
|
||||
|
@ -206,7 +207,9 @@ app.controller('GisMapController', ($scope, $route, config, kbnUrl, localStorage
|
|||
]);
|
||||
|
||||
async function doSave(saveOptions) {
|
||||
savedMap.syncWithStore(getStore().getState());
|
||||
const store = getStore();
|
||||
await store.dispatch(clearTransientLayerStateAndCloseFlyout());
|
||||
savedMap.syncWithStore(store.getState());
|
||||
const docTitle = Private(DocTitleProvider);
|
||||
let id;
|
||||
|
||||
|
|
|
@ -6,42 +6,41 @@
|
|||
|
||||
import { connect } from 'react-redux';
|
||||
import { AddLayerPanel } from './view';
|
||||
import { getFlyoutDisplay, updateFlyout, FLYOUT_STATE }
|
||||
from '../../store/ui';
|
||||
import { getTemporaryLayers } from "../../selectors/map_selectors";
|
||||
import { getFlyoutDisplay, updateFlyout, FLYOUT_STATE } from '../../store/ui';
|
||||
import { getSelectedLayer } from '../../selectors/map_selectors';
|
||||
import {
|
||||
clearTransientLayerStateAndCloseFlyout,
|
||||
setTransientLayer,
|
||||
addLayer,
|
||||
removeLayer,
|
||||
clearTemporaryLayers,
|
||||
setSelectedLayer,
|
||||
removeTransientLayer
|
||||
} from "../../actions/store_actions";
|
||||
import _ from 'lodash';
|
||||
|
||||
function mapStateToProps(state = {}) {
|
||||
|
||||
function isLoading() {
|
||||
const tmp = getTemporaryLayers(state);
|
||||
return tmp.some((layer) => layer.isLayerLoading());
|
||||
}
|
||||
const selectedLayer = getSelectedLayer(state);
|
||||
return {
|
||||
flyoutVisible: getFlyoutDisplay(state) !== FLYOUT_STATE.NONE,
|
||||
layerLoading: isLoading(),
|
||||
temporaryLayers: !_.isEmpty(getTemporaryLayers(state))
|
||||
hasLayerSelected: !!selectedLayer,
|
||||
isLoading: selectedLayer && selectedLayer.isLayerLoading(),
|
||||
};
|
||||
}
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return {
|
||||
closeFlyout: () => {
|
||||
dispatch(updateFlyout(FLYOUT_STATE.NONE));
|
||||
dispatch(clearTemporaryLayers());
|
||||
clearTransientLayerStateAndCloseFlyout();
|
||||
},
|
||||
previewLayer: (layer) => {
|
||||
previewLayer: layer => {
|
||||
dispatch(addLayer(layer.toLayerDescriptor()));
|
||||
dispatch(setSelectedLayer(layer.getId()));
|
||||
dispatch(setTransientLayer(layer.getId()));
|
||||
},
|
||||
removeLayer: id => dispatch(removeLayer(id)),
|
||||
nextAction: id => {
|
||||
dispatch(setSelectedLayer(id));
|
||||
removeTransientLayer: () => {
|
||||
dispatch(setSelectedLayer(null));
|
||||
dispatch(removeTransientLayer());
|
||||
},
|
||||
selectLayerAndAdd: () => {
|
||||
dispatch(setTransientLayer(null));
|
||||
dispatch(updateFlyout(FLYOUT_STATE.LAYER_PANEL));
|
||||
},
|
||||
};
|
||||
|
|
|
@ -23,26 +23,25 @@ import {
|
|||
|
||||
export class AddLayerPanel extends Component {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.state = {
|
||||
sourceType: null,
|
||||
};
|
||||
state = {
|
||||
sourceType: null,
|
||||
isLoading: false,
|
||||
hasLayerSelected: false,
|
||||
layer: null
|
||||
}
|
||||
|
||||
_previewLayer = (source) => {
|
||||
this.layer = source.createDefaultLayer({
|
||||
temporary: true,
|
||||
});
|
||||
this.props.previewLayer(this.layer);
|
||||
this.setState({
|
||||
layer: source.createDefaultLayer({})
|
||||
},
|
||||
() => this.props.previewLayer(this.state.layer));
|
||||
};
|
||||
|
||||
_clearSource = () => {
|
||||
this.setState({ sourceType: null });
|
||||
|
||||
if (this.layer) {
|
||||
this.props.removeLayer(this.layer.getId());
|
||||
if (this.state.layer) {
|
||||
this.props.removeTransientLayer();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,17 +54,16 @@ export class AddLayerPanel extends Component {
|
|||
return null;
|
||||
}
|
||||
|
||||
const { layerLoading, temporaryLayers, nextAction } = this.props;
|
||||
const { hasLayerSelected, isLoading, selectLayerAndAdd } = this.props;
|
||||
return (
|
||||
<EuiButton
|
||||
disabled={!temporaryLayers || layerLoading}
|
||||
isLoading={layerLoading}
|
||||
disabled={!hasLayerSelected}
|
||||
isLoading={hasLayerSelected && isLoading}
|
||||
iconSide="right"
|
||||
iconType={'sortRight'}
|
||||
onClick={() => {
|
||||
const layerId = this.layer.getId();
|
||||
this.layer = null;
|
||||
return nextAction(layerId);
|
||||
this.setState({ layer: null });
|
||||
selectLayerAndAdd();
|
||||
}}
|
||||
fill
|
||||
>
|
||||
|
@ -164,7 +162,11 @@ export class AddLayerPanel extends Component {
|
|||
<EuiFlexGroup justifyContent="spaceBetween" responsive={false}>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty
|
||||
onClick={this.props.closeFlyout}
|
||||
onClick={() => {
|
||||
if (this.state.layer) {
|
||||
this.props.closeFlyout();
|
||||
}
|
||||
}}
|
||||
flush="left"
|
||||
>
|
||||
Cancel
|
||||
|
|
|
@ -8,35 +8,21 @@ import { connect } from 'react-redux';
|
|||
import { FlyoutFooter } from './view';
|
||||
import { updateFlyout, FLYOUT_STATE } from '../../../store/ui';
|
||||
import {
|
||||
clearTemporaryLayers,
|
||||
setSelectedLayer,
|
||||
removeSelectedLayer,
|
||||
promoteTemporaryLayers,
|
||||
rollbackToTrackedLayerStateForSelectedLayer,
|
||||
removeTrackedLayerStateForSelectedLayer
|
||||
} from '../../../actions/store_actions';
|
||||
import { getSelectedLayer } from '../../../selectors/map_selectors';
|
||||
|
||||
const mapStateToProps = state => {
|
||||
const selectedLayer = getSelectedLayer(state);
|
||||
return {
|
||||
isNewLayer: selectedLayer.isTemporary()
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
cancelLayerPanel: async () => {
|
||||
await dispatch(updateFlyout(FLYOUT_STATE.NONE));
|
||||
await dispatch(clearTemporaryLayers());
|
||||
await dispatch(rollbackToTrackedLayerStateForSelectedLayer());
|
||||
await dispatch(setSelectedLayer(null));
|
||||
},
|
||||
saveLayerEdits: isNewLayer => {
|
||||
saveLayerEdits: () => {
|
||||
dispatch(updateFlyout(FLYOUT_STATE.NONE));
|
||||
if (isNewLayer) {
|
||||
dispatch(promoteTemporaryLayers());
|
||||
}
|
||||
dispatch(removeTrackedLayerStateForSelectedLayer());
|
||||
dispatch(setSelectedLayer(null));
|
||||
},
|
||||
|
@ -48,5 +34,5 @@ const mapDispatchToProps = (dispatch) => {
|
|||
};
|
||||
};
|
||||
|
||||
const connectedFlyoutFooter = connect(mapStateToProps, mapDispatchToProps)(FlyoutFooter);
|
||||
const connectedFlyoutFooter = connect(null, mapDispatchToProps)(FlyoutFooter);
|
||||
export { connectedFlyoutFooter as FlyoutFooter };
|
||||
|
|
|
@ -14,21 +14,19 @@ import {
|
|||
EuiButtonEmpty,
|
||||
} from '@elastic/eui';
|
||||
export const FlyoutFooter = ({ cancelLayerPanel, saveLayerEdits, removeLayer,
|
||||
isNewLayer }) => {
|
||||
const removeBtn = isNewLayer
|
||||
? null
|
||||
: (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty
|
||||
color="danger"
|
||||
onClick={removeLayer}
|
||||
flush="right"
|
||||
data-test-subj="mapRemoveLayerButton"
|
||||
>
|
||||
Remove layer
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
);
|
||||
hasStateChanged }) => {
|
||||
const removeBtn = (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty
|
||||
color="danger"
|
||||
onClick={removeLayer}
|
||||
flush="right"
|
||||
data-test-subj="mapRemoveLayerButton"
|
||||
>
|
||||
Remove layer
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
);
|
||||
|
||||
return (
|
||||
<EuiFlexGroup responsive={false}>
|
||||
|
@ -37,7 +35,7 @@ export const FlyoutFooter = ({ cancelLayerPanel, saveLayerEdits, removeLayer,
|
|||
onClick={cancelLayerPanel}
|
||||
flush="left"
|
||||
>
|
||||
Cancel
|
||||
{hasStateChanged ? 'Cancel' : 'Close'}
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
|
@ -46,8 +44,9 @@ export const FlyoutFooter = ({ cancelLayerPanel, saveLayerEdits, removeLayer,
|
|||
{removeBtn}
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButton
|
||||
disabled={!hasStateChanged}
|
||||
iconType="check"
|
||||
onClick={() => saveLayerEdits(isNewLayer)}
|
||||
onClick={saveLayerEdits}
|
||||
fill
|
||||
>
|
||||
Save & close
|
||||
|
|
|
@ -6,14 +6,16 @@
|
|||
|
||||
import { connect } from 'react-redux';
|
||||
import { LayerPanel } from './view';
|
||||
import { getSelectedLayer } from '../../selectors/map_selectors';
|
||||
import { getSelectedLayer, hasDirtyState } from '../../selectors/map_selectors';
|
||||
import {
|
||||
fitToLayerExtent
|
||||
} from '../../actions/store_actions';
|
||||
|
||||
function mapStateToProps(state = {}) {
|
||||
const selectedLayer = getSelectedLayer(state);
|
||||
return {
|
||||
selectedLayer: getSelectedLayer(state)
|
||||
selectedLayer,
|
||||
hasStateChanged: hasDirtyState(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@ export class LayerPanel extends React.Component {
|
|||
prevId: nextId,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -161,7 +160,7 @@ export class LayerPanel extends React.Component {
|
|||
</EuiFlyoutBody>
|
||||
|
||||
<EuiFlyoutFooter className="mapLayerPanel__footer">
|
||||
<FlyoutFooter/>
|
||||
<FlyoutFooter hasStateChanged={this.props.hasStateChanged}/>
|
||||
</EuiFlyoutFooter>
|
||||
</EuiFlexGroup>
|
||||
);
|
||||
|
|
|
@ -8,7 +8,12 @@ import _ from 'lodash';
|
|||
import { connect } from 'react-redux';
|
||||
import { TOCEntry } from './view';
|
||||
import { updateFlyout, FLYOUT_STATE } from '../../../../../store/ui';
|
||||
import { fitToLayerExtent, setSelectedLayer, toggleLayerVisible } from '../../../../../actions/store_actions';
|
||||
import {
|
||||
fitToLayerExtent,
|
||||
setSelectedLayer,
|
||||
toggleLayerVisible,
|
||||
removeTransientLayer
|
||||
} from '../../../../../actions/store_actions';
|
||||
|
||||
import { hasDirtyState, getSelectedLayer } from '../../../../../selectors/map_selectors';
|
||||
|
||||
|
@ -26,8 +31,9 @@ function mapStateToProps(state = {}) {
|
|||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return ({
|
||||
openLayerPanel: layerId => {
|
||||
dispatch(setSelectedLayer(layerId));
|
||||
openLayerPanel: async layerId => {
|
||||
await dispatch(removeTransientLayer());
|
||||
await dispatch(setSelectedLayer(layerId));
|
||||
dispatch(updateFlyout(FLYOUT_STATE.LAYER_PANEL));
|
||||
},
|
||||
toggleVisible: layerId => {
|
||||
|
|
|
@ -69,6 +69,8 @@ export const getSelectedLayerId = ({ map }) => {
|
|||
return (!map.selectedLayerId || !map.layerList) ? null : map.selectedLayerId;
|
||||
};
|
||||
|
||||
export const getTransientLayerId = ({ map }) => map.__transientLayerId;
|
||||
|
||||
export const getLayerListRaw = ({ map }) => map.layerList ? map.layerList : [];
|
||||
|
||||
export const getWaitingForMapReadyLayerListRaw = ({ map }) => map.waitingForMapReadyLayerList
|
||||
|
@ -92,10 +94,8 @@ export const getMouseCoordinates = ({ map }) => map.mapState.mouseCoordinates;
|
|||
export const getMapColors = ({ map }) => {
|
||||
return map.layerList.reduce((accu, layer) => {
|
||||
// This will evolve as color options are expanded
|
||||
if (!layer.temporary) {
|
||||
const color = _.get(layer, 'style.properties.fillColor.options.color');
|
||||
if (color) accu.push(color);
|
||||
}
|
||||
const color = _.get(layer, 'style.properties.fillColor.options.color');
|
||||
if (color) accu.push(color);
|
||||
return accu;
|
||||
}, []);
|
||||
};
|
||||
|
@ -162,8 +162,6 @@ export const getUniqueIndexPatternIds = createSelector(
|
|||
}
|
||||
);
|
||||
|
||||
export const getTemporaryLayers = createSelector(getLayerList, (layerList) => layerList.filter(layer => layer.isTemporary()));
|
||||
|
||||
export const hasDirtyState = createSelector(getLayerListRaw, (layerListRaw) => {
|
||||
return layerListRaw.some(layerDescriptor => {
|
||||
const currentState = copyPersistentState(layerDescriptor);
|
||||
|
|
|
@ -39,7 +39,6 @@ export class AbstractLayer {
|
|||
layerDescriptor.maxZoom = _.get(options, 'maxZoom', 24);
|
||||
layerDescriptor.alpha = _.get(options, 'alpha', 0.75);
|
||||
layerDescriptor.visible = _.get(options, 'visible', true);
|
||||
layerDescriptor.temporary = _.get(options, 'temporary', false);
|
||||
layerDescriptor.style = _.get(options, 'style', {});
|
||||
return layerDescriptor;
|
||||
}
|
||||
|
@ -121,10 +120,6 @@ export class AbstractLayer {
|
|||
};
|
||||
}
|
||||
|
||||
isTemporary() {
|
||||
return this._descriptor.temporary;
|
||||
}
|
||||
|
||||
getSupportedStyles() {
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import {
|
||||
SET_SELECTED_LAYER,
|
||||
SET_TRANSIENT_LAYER,
|
||||
UPDATE_LAYER_ORDER,
|
||||
LAYER_DATA_LOAD_STARTED,
|
||||
LAYER_DATA_LOAD_ENDED,
|
||||
|
@ -15,7 +16,6 @@ import {
|
|||
ADD_WAITING_FOR_MAP_READY_LAYER,
|
||||
CLEAR_WAITING_FOR_MAP_READY_LAYER_LIST,
|
||||
REMOVE_LAYER,
|
||||
PROMOTE_TEMPORARY_LAYERS,
|
||||
TOGGLE_LAYER_VISIBLE,
|
||||
MAP_EXTENT_CHANGED,
|
||||
MAP_READY,
|
||||
|
@ -96,6 +96,7 @@ const INITIAL_STATE = {
|
|||
refreshTimerLastTriggeredAt: null,
|
||||
},
|
||||
selectedLayerId: null,
|
||||
__transientLayerId: null,
|
||||
layerList: [],
|
||||
waitingForMapReadyLayerList: [],
|
||||
};
|
||||
|
@ -221,8 +222,11 @@ export function map(state = INITIAL_STATE, action) {
|
|||
}
|
||||
};
|
||||
case SET_SELECTED_LAYER:
|
||||
const match = state.layerList.find(layer => layer.id === action.selectedLayerId);
|
||||
return { ...state, selectedLayerId: match ? action.selectedLayerId : null };
|
||||
const selectedMatch = state.layerList.find(layer => layer.id === action.selectedLayerId);
|
||||
return { ...state, selectedLayerId: selectedMatch ? action.selectedLayerId : null };
|
||||
case SET_TRANSIENT_LAYER:
|
||||
const transientMatch = state.layerList.find(layer => layer.id === action.transientLayerId);
|
||||
return { ...state, __transientLayerId: transientMatch ? action.transientLayerId : null };
|
||||
case UPDATE_LAYER_ORDER:
|
||||
return { ...state, layerList: action.newLayerOrder.map(layerNumber => state.layerList[layerNumber]) };
|
||||
case UPDATE_LAYER_PROP:
|
||||
|
@ -265,13 +269,6 @@ export function map(state = INITIAL_STATE, action) {
|
|||
...state,
|
||||
waitingForMapReadyLayerList: []
|
||||
};
|
||||
//TODO: Handle more than one
|
||||
case PROMOTE_TEMPORARY_LAYERS:
|
||||
const tempLayer = state.layerList.find(({ temporary }) => temporary);
|
||||
return tempLayer
|
||||
? updateLayerInList(state, tempLayer.id, 'temporary', false)
|
||||
: state;
|
||||
// TODO: Simplify cases below
|
||||
case TOGGLE_LAYER_VISIBLE:
|
||||
return updateLayerInList(state, action.layerId, 'visible');
|
||||
case UPDATE_LAYER_STYLE:
|
||||
|
|
|
@ -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\":{}},\"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\"}]",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"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\"},\"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}}}},\"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\"},\"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}}}},\"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\":{}},\"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\"}]",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"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\"},\"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}}}},\"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\":[]},\"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}}}},\"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\":{}},\"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\"}]",
|
||||
"layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"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\"},\"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}}}},\"type\":\"VECTOR\"}]",
|
||||
"uiStateJSON":"{}",
|
||||
"bounds":{
|
||||
"type":"polygon",
|
||||
|
|
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},\"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\"}]",
|
||||
"layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"visible\":true,\"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,\"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}}}},\"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,\"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}}}},\"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,\"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}}}},\"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},\"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\"}]",
|
||||
"layerListJSON":"[{\"id\":\"0hmz5\",\"alpha\":1,\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"visible\":true,\"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,\"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}}}},\"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,\"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}}}},\"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,\"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}}}},\"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