kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
35 lines (33 loc) • 10.3 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mapStateReducerFactory = exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _reduxActions = require("redux-actions");
var _actions = require("@kepler.gl/actions");
var mapStateUpdaters = _interopRequireWildcard(require("./map-state-updaters"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
/**
* Important: Do not rename `actionHandler` or the assignment pattern of property value.
* It is used to generate documentation
*/
var actionHandler = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _actions.ActionTypes.UPDATE_MAP, mapStateUpdaters.updateMapUpdater), _actions.ActionTypes.FIT_BOUNDS, mapStateUpdaters.fitBoundsUpdater), _actions.ActionTypes.TOGGLE_PERSPECTIVE, mapStateUpdaters.togglePerspectiveUpdater), _actions.ActionTypes.RECEIVE_MAP_CONFIG, mapStateUpdaters.receiveMapConfigUpdater), _actions.ActionTypes.RESET_MAP_CONFIG, mapStateUpdaters.resetMapConfigUpdater), _actions.ActionTypes.TOGGLE_SPLIT_MAP, mapStateUpdaters.toggleSplitMapUpdater), _actions.ActionTypes.TOGGLE_SPLIT_MAP_VIEWPORT, mapStateUpdaters.toggleSplitMapViewportUpdater);
/* Reducer */
var mapStateReducerFactory = exports.mapStateReducerFactory = function mapStateReducerFactory() {
var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return (
// @ts-expect-error
(0, _reduxActions.handleActions)(actionHandler, _objectSpread(_objectSpread(_objectSpread({}, mapStateUpdaters.INITIAL_MAP_STATE), initialState), {}, {
initialState: initialState
}))
);
};
var _default = exports["default"] = mapStateReducerFactory();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVkdXhBY3Rpb25zIiwicmVxdWlyZSIsIl9hY3Rpb25zIiwibWFwU3RhdGVVcGRhdGVycyIsIl9pbnRlcm9wUmVxdWlyZVdpbGRjYXJkIiwiX2dldFJlcXVpcmVXaWxkY2FyZENhY2hlIiwiZSIsIldlYWtNYXAiLCJyIiwidCIsIl9fZXNNb2R1bGUiLCJfdHlwZW9mIiwiaGFzIiwiZ2V0IiwibiIsIl9fcHJvdG9fXy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