UNPKG

kepler.gl

Version:

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

38 lines (37 loc) 5.38 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _react = _interopRequireDefault(require("react")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _checkbox = _interopRequireDefault(require("./checkbox")); var _commonUtils = require("@kepler.gl/common-utils"); var _templateObject; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var MapLayerSelect = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding: 12px;\n\n .map-layer-selector__item {\n margin: 12px 0;\n }\n"]))); /** @type {typeof import('./map-layer-selector').default} */ var MapLayerSelector = function MapLayerSelector(_ref) { var layers = _ref.layers, onMapToggleLayer = _ref.onMapToggleLayer; return /*#__PURE__*/_react["default"].createElement(MapLayerSelect, { className: "map-layer-selector" }, layers.map(function (layer) { return /*#__PURE__*/_react["default"].createElement("div", { key: layer.id, className: "map-layer-selector__item" }, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], { type: "radio", checked: layer.isVisible, id: "".concat(layer.id, "-toggle-").concat((0, _commonUtils.generateHashId)(4)), label: layer.name, onChange: function onChange() { onMapToggleLayer(layer.id); } })); })); }; var _default = exports["default"] = MapLayerSelector; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9zdHlsZWRDb21wb25lbnRzIiwiX2NoZWNrYm94IiwiX2NvbW1vblV0aWxzIiwiX3RlbXBsYXRlT2JqZWN0IiwiTWFwTGF5ZXJTZWxlY3QiLCJzdHlsZWQiLCJkaXYiLCJfdGFnZ2VkVGVtcGxhdGVM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