UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

137 lines (133 loc) 20.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getEditorLayer = getEditorLayer; var _layers = require("@nebula.gl/layers"); var _editModes = require("@nebula.gl/edit-modes"); var _extensions = require("@deck.gl/extensions"); var _constants = require("@kepler.gl/constants"); var _commonUtils = require("@kepler.gl/common-utils"); var _constants2 = require("./constants"); var _featureStyles = require("./feature-styles"); var _modifyModeExtended = require("./modify-mode-extended"); var _editorLayerUtils = require("./editor-layer-utils"); // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var DEFAULT_COMPOSITE_MODE = new _editModes.CompositeMode([new _editModes.TranslateMode(), new _modifyModeExtended.ModifyModeExtended()]); /** * Returns editable layer to edit polygon filters. * @param params * @param params.editorMenuActive Indicates whether the editor side menu is active. * @param params.editor * @param params.onSetFeatures A callback to set features. * @param params.setSelectedFeature A callback to set selected feature and selection context. * @param params.viewport Current viewport. * @param params.featureCollection Feature collection with an array of features * @param params.selectedFeatureIndexes An array with index of currently selected feature. */ function getEditorLayer(_ref) { var editorMenuActive = _ref.editorMenuActive, editor = _ref.editor, onSetFeatures = _ref.onSetFeatures, setSelectedFeature = _ref.setSelectedFeature, featureCollection = _ref.featureCollection, selectedFeatureIndexes = _ref.selectedFeatureIndexes, viewport = _ref.viewport; var editorMode = editor.mode; var mode = DEFAULT_COMPOSITE_MODE; if (editorMenuActive) { // @ts-ignore if (editorMode === _constants.EDITOR_MODES.DRAW_POLYGON) mode = _editModes.DrawPolygonMode; // @ts-ignore else if (editorMode === _constants.EDITOR_MODES.DRAW_RECTANGLE) mode = _editModes.DrawRectangleMode; } // @ts-ignore return new _layers.EditableGeoJsonLayer({ id: _constants.EDITOR_LAYER_ID, mode: mode, // @ts-ignore data: featureCollection, selectedFeatureIndexes: selectedFeatureIndexes, visible: editor.visible, pickable: true, pickingRadius: _constants.EDITOR_LAYER_PICKING_RADIUS, modeConfig: { viewport: viewport, screenSpace: true, lockRectangles: true }, pickingLineWidthExtraPixels: 5, // Only show fill when polygons are selected, // there is no way atm to enable fill for only one feature filled: selectedFeatureIndexes.length > 0, onEdit: function onEdit(_ref2) { var updatedData = _ref2.updatedData, editType = _ref2.editType; switch (editType) { case _constants2.EDIT_TYPES.ADD_FEATURE: { var _features = updatedData.features; if (_features.length) { var lastFeature = _features[_features.length - 1]; lastFeature.properties.isClosed = true; lastFeature.id = (0, _commonUtils.generateHashId)(6); onSetFeatures(updatedData.features); setSelectedFeature(lastFeature); } break; } case _constants2.EDIT_TYPES.ADD_POSITION: case _constants2.EDIT_TYPES.MOVE_POSITION: case _constants2.EDIT_TYPES.TRANSLATING: onSetFeatures(updatedData.features); break; default: break; } }, // prevent self-highlights with tentative features autoHighlight: !(0, _editorLayerUtils.isDrawingActive)(editorMenuActive, editorMode), // @ts-ignore highlightColor: function highlightColor(info) { // Note: lines are reported as parent polygon var object = info.object; if (object) { var _editor$selectedFeatu; if (object.id === ((_editor$selectedFeatu = editor.selectedFeature) === null || _editor$selectedFeatu === void 0 ? void 0 : _editor$selectedFeatu.id)) { return _featureStyles.FEATURE_STYLE.highlightMultiplierNone; } var type = object.properties.editHandleType; if (type === 'intermediate') return _featureStyles.EDIT_HANDLE_STYLE.highlightMultiplierNone;else if (type === 'existing') return _featureStyles.EDIT_HANDLE_STYLE.highlightMultiplier; } // Note: highlight color affects even transparent filled polygons return selectedFeatureIndexes.length ? _featureStyles.FEATURE_STYLE.highlightMultiplier : _featureStyles.LINE_STYLE.highlightMultiplier; }, extensions: [new _extensions.PathStyleExtension({ dash: true })], dashGapPickable: true, getDashArray: function getDashArray(feature) { var _feature$properties, _editor$selectedFeatu2; if ((feature === null || feature === void 0 || (_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.guideType) === 'tentative') { return _featureStyles.LINE_STYLE.dashArray; } if ((feature === null || feature === void 0 ? void 0 : feature.id) === ((_editor$selectedFeatu2 = editor.selectedFeature) === null || _editor$selectedFeatu2 === void 0 ? void 0 : _editor$selectedFeatu2.id)) return _featureStyles.LINE_STYLE.solidArray; return _featureStyles.LINE_STYLE.dashArray; }, getLineColor: _featureStyles.LINE_STYLE.getColor, getFillColor: _featureStyles.FEATURE_STYLE.getColor, getRadius: _featureStyles.EDIT_HANDLE_STYLE.getRadius, // @ts-ignore getLineWidth: _featureStyles.LINE_STYLE.getWidth, getEditHandlePointRadius: _featureStyles.EDIT_HANDLE_STYLE.getRadius, getEditHandlePointColor: _featureStyles.EDIT_HANDLE_STYLE.getFillColor, getEditHandlePointOutlineColor: _featureStyles.EDIT_HANDLE_STYLE.getOutlineColor, getTentativeLineColor: _featureStyles.LINE_STYLE.getTentativeLineColor, // @ts-ignore getTentativeLineWidth: _featureStyles.LINE_STYLE.getTentativeLineWidth, getTentativeFillColor: _featureStyles.LINE_STYLE.getTentativeFillColor, parameters: {} }); } //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbGF5ZXJzIiwicmVxdWlyZSIsIl9lZGl0TW9kZXMiLCJfZXh0ZW5zaW9ucyIsIl9jb25zdGFudHMiLCJfY29tbW9uVXRpbHMiLCJfY29uc3RhbnRzMiIsIl9mZWF0dXJlU3R5bGVzIiwiX21vZGlmeU1vZGVFeHRlbmRlZCIsIl9lZGl0b3JMYXllclV0aWxzIiwiREVGQVVMVF9DT01QT1NJVEVfTU9ERSIsIkNvbXBvc2l0ZU1vZGUiLCJUcmFuc2xhdGVNb2RlIiwiTW9kaWZ5TW9kZUV4dGVuZGVkIiwiZ2V0RWRpdG9yTGF5ZXIiLCJfcmVmIiwiZWRpdG9yTWVudUFjdGl2ZSIsImVkaXRvciIsIm9uU2V0RmVhdHVyZXMiLCJzZXRTZWxlY3RlZEZlYXR1cmUiLCJmZWF0dXJlQ29sbGVjdGlvbiIsInNlbGVjdGVkRmVhdHVyZUluZGV4ZXMiLCJ2aWV3cG9ydCIsImVkaXRvck1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