UNPKG

kepler.gl

Version:

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

279 lines (227 loc) 29.7 kB
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _react = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _reactMapGlDraw = require("react-map-gl-draw"); var _window = _interopRequireDefault(require("global/window")); var _classnames = _interopRequireDefault(require("classnames")); var _lodash = _interopRequireDefault(require("lodash.get")); var _defaultSettings = require("../../constants/default-settings"); var _featureActionPanel = _interopRequireDefault(require("./feature-action-panel")); var _featureStyles = require("./feature-styles"); var _handleStyle = require("./handle-style"); var _constants = require("../../constants"); var _reselect = require("reselect"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _templateObject() { var data = (0, _taggedTemplateLiteral2["default"])(["\n cursor: ", ";\n position: relative;\n"]); _templateObject = function _templateObject() { return data; }; return data; } var DELETE_KEY_EVENT_CODE = 46; var BACKSPACE_KEY_EVENT_CODE = 8; var ESCAPE_KEY_EVENT_CODE = 27; var StyledWrapper = _styledComponents["default"].div(_templateObject(), function (props) { return props.editor.mode === _constants.EDITOR_MODES.EDIT ? 'pointer' : 'crosshair'; }); var editorLayerFilter = function editorLayerFilter(layer) { return _defaultSettings.EDITOR_AVAILABLE_LAYERS.includes(layer.type); }; var Editor = /*#__PURE__*/ function (_Component) { (0, _inherits2["default"])(Editor, _Component); function Editor() { var _getPrototypeOf2; var _this; (0, _classCallCheck2["default"])(this, Editor); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(Editor)).call.apply(_getPrototypeOf2, [this].concat(args))); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", { showActions: false, lastPosition: null }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "layerSelector", function (props) { return props.layers; }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "layersToRenderSelector", function (props) { return props.layersToRender; }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "filterSelector", function (props) { return props.filters; }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "selectedFeatureIdSelector", function (props) { return (0, _lodash["default"])(props, ['editor', 'selectedFeature', 'id']); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "editorFeatureSelector", function (props) { return (0, _lodash["default"])(props, ['editor', 'features']); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "currentFilterSelector", (0, _reselect.createSelector)(_this.filterSelector, _this.selectedFeatureIdSelector, function (filters, selectedFeatureId) { return filters.find(function (f) { return f.value && f.value.id === selectedFeatureId; }); })); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "availableLayersSeletor", (0, _reselect.createSelector)(_this.layerSelector, _this.layersToRenderSelector, function (layers, layersToRender) { return layers.filter(editorLayerFilter).filter(function (layer) { return layersToRender[layer.id]; }); })); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "allFeaturesSelector", (0, _reselect.createSelector)(_this.filterSelector, _this.editorFeatureSelector, function (filters, editorFeatures) { return filters.filter(function (f) { return f.type === _defaultSettings.FILTER_TYPES.polygon; }).map(function (f) { return f.value; }).concat(editorFeatures); })); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onKeyPressed", function (event) { var isEnabled = _this.props.isEnabled; if (!isEnabled) { return; } switch (event.which) { case DELETE_KEY_EVENT_CODE: case BACKSPACE_KEY_EVENT_CODE: _this._onDeleteSelectedFeature(); break; case ESCAPE_KEY_EVENT_CODE: _this.props.onSelect(null); break; default: break; } }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onSelect", function (_ref) { var selectedFeatureId = _ref.selectedFeatureId, sourceEvent = _ref.sourceEvent; var allFeatures = _this.allFeaturesSelector(_this.props); _this.setState(_objectSpread({}, sourceEvent.rightButton ? { showActions: true, lastPosition: { x: sourceEvent.changedPointers[0].offsetX, y: sourceEvent.changedPointers[0].offsetY } } : null), function () { _this.props.onSelect(allFeatures.find(function (f) { return f.id === selectedFeatureId; })); }); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onDeleteSelectedFeature", function () { if (_this.state.showActions) { _this.setState({ showActions: false }); } var editor = _this.props.editor; var _editor$selectedFeatu = editor.selectedFeature, selectedFeature = _editor$selectedFeatu === void 0 ? {} : _editor$selectedFeatu; _this.props.onDeleteFeature(selectedFeature); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_closeFeatureAction", function () { _this.setState({ showActions: false }); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onToggleLayer", function (layer) { var selectedFeature = _this.props.editor.selectedFeature; if (!selectedFeature) { return; } _this.props.onTogglePolygonFilter(layer, selectedFeature); }); return _this; } (0, _createClass2["default"])(Editor, [{ key: "componentDidMount", value: function componentDidMount() { _window["default"].addEventListener('keydown', this._onKeyPressed); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { _window["default"].removeEventListener('keydown', this._onKeyPressed); } }, { key: "render", value: function render() { var _this$props = this.props, className = _this$props.className, clickRadius = _this$props.clickRadius, datasets = _this$props.datasets, editor = _this$props.editor, onUpdate = _this$props.onUpdate, style = _this$props.style; var _this$state = this.state, lastPosition = _this$state.lastPosition, showActions = _this$state.showActions; var selectedFeatureId = (0, _lodash["default"])(editor, ['selectedFeature', 'id']); var currentFilter = this.currentFilterSelector(this.props); var availableLayers = this.availableLayersSeletor(this.props); var allFeatures = this.allFeaturesSelector(this.props); return _react["default"].createElement(StyledWrapper, { editor: editor, className: (0, _classnames["default"])('editor', className), style: style }, _react["default"].createElement(_reactMapGlDraw.Editor, { clickRadius: clickRadius, mode: editor.mode, features: allFeatures, selectedFeatureId: selectedFeatureId, onSelect: this._onSelect, onUpdate: onUpdate, getEditHandleShape: _handleStyle.getEditHandleShape, getFeatureStyle: _featureStyles.getStyle, getEditHandleStyle: _handleStyle.getStyle }), showActions && Boolean(selectedFeatureId) ? _react["default"].createElement(_featureActionPanel["default"], { datasets: datasets, layers: availableLayers, currentFilter: currentFilter, onClose: this._closeFeatureAction, onDeleteFeature: this._onDeleteSelectedFeature, onToggleLayer: this._onToggleLayer, position: lastPosition }) : null); } }]); return Editor; }(_react.Component); (0, _defineProperty2["default"])(Editor, "propTypes", { filters: _propTypes["default"].arrayOf(_propTypes["default"].object).isRequired, layers: _propTypes["default"].arrayOf(_propTypes["default"].object).isRequired, datasets: _propTypes["default"].object.isRequired, editor: _propTypes["default"].object.isRequired, layersToRender: _propTypes["default"].object.isRequired, onSelect: _propTypes["default"].func.isRequired, onUpdate: _propTypes["default"].func.isRequired, onDeleteFeature: _propTypes["default"].func.isRequired, onTogglePolygonFilter: _propTypes["default"].func.isRequired, index: _propTypes["default"].number, classnames: _propTypes["default"].string, clickRadius: _propTypes["default"].number, isEnabled: _propTypes["default"].bool }); (0, _defineProperty2["default"])(Editor, "defaultProps", { clickRadius: _featureStyles.DEFAULT_RADIUS }); var _default = Editor; exports["default"] = _default; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2VkaXRvci9lZGl0b3IuanMiXSwibmFtZXMiOlsiREVMRVRFX0tFWV9FVkVOVF9DT0RFIiwiQkFDS1NQQUNFX0tFWV9FVkVOVF9DT0RFIiwiRVNDQVBFX0tFWV9FVkVOVF9DT0RFIiwiU3R5bGVkV3JhcHBlciIsInN0eWxlZCIsImRpdiIsInByb3BzIiwiZWRpdG9yIiwibW9kZSIsIkVESVRPUl9NT0RFUyIsIkVESVQiLCJlZGl0b3JMYXllckZpbHRlciIsImxheWVyIiwiRURJVE9SX0FWQUlMQUJMRV9MQVlFUlMiLCJpbmNsdWRlcyIsInR5cGUiLCJFZGl0b3IiLCJzaG93QWN0aW9ucyIsImxhc3RQb3NpdGlvbiIsImxheWVycyIsImxheWVyc1RvUmVuZGVyIiwiZmlsdGVycyIsImZpbHRlclNlbGVjdG9yIiwic2VsZWN0ZWRGZWF0dXJlSWRTZWxlY3RvciIsInNlbGVjdGVkRmVhdHVyZUlkIiwiZmluZCIsImYiLCJ2YWx1ZSIsImlkIiwibGF5ZXJTZWxlY3RvciIsImxheWVyc1RvUmVu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