diff --git a/web/client/components/TOC/fragments/settings/Display.jsx b/web/client/components/TOC/fragments/settings/Display.jsx index d4f93e06e4..acea7b9a83 100644 --- a/web/client/components/TOC/fragments/settings/Display.jsx +++ b/web/client/components/TOC/fragments/settings/Display.jsx @@ -21,6 +21,7 @@ import { ServerTypes } from '../../../../utils/LayersUtils'; import Select from 'react-select'; import { getSupportedFormat } from '../../../../api/WMS'; import WMSCacheOptions from './WMSCacheOptions'; +import ThreeDTilesSettings from './ThreeDTilesSettings'; export default class extends React.Component { static propTypes = { opacityText: PropTypes.node, @@ -206,18 +207,10 @@ export default class extends React.Component { - {this.props.element.type === "3dtiles" && - - - - this.props.onChange("heightOffset", parseFloat(val))}/> - - - } + {this.props.element.type === "wms" && diff --git a/web/client/components/TOC/fragments/settings/PointCloudShadingSettings.jsx b/web/client/components/TOC/fragments/settings/PointCloudShadingSettings.jsx new file mode 100644 index 0000000000..20f3673ca2 --- /dev/null +++ b/web/client/components/TOC/fragments/settings/PointCloudShadingSettings.jsx @@ -0,0 +1,140 @@ +/* + * Copyright 2023, GeoSolutions Sas. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + + +import React from 'react'; +import PropTypes from 'prop-types'; +import { FormGroup, ControlLabel, InputGroup, Checkbox } from 'react-bootstrap'; +import DebouncedFormControl from '../../../misc/DebouncedFormControl'; +import Message from '../../../I18N/Message'; +import InfoPopover from '../../../widgets/widget/InfoPopover'; + +/** + * PointCloudShadingSettings. This component shows the point cloud shading options available + * @prop {object} layer the layer options + * @prop {object} onChange callback on every on change event + */ +function PointCloudShadingSettings({ + layer, + onChange +}) { + if (!(layer?.type === '3dtiles' && layer?.format === 'pnts')) { + return null; + } + const { pointCloudShading = {} } = layer || {}; + return ( + <> +
+ + onChange('pointCloudShading', { + ...pointCloudShading, + attenuation: event?.target?.checked, + maximumAttenuation: pointCloudShading?.maximumAttenuation ?? 4, + eyeDomeLighting: pointCloudShading?.eyeDomeLighting ?? true + })} + > + + {' '}} /> + + + + + + + + { + onChange('pointCloudShading', { + ...pointCloudShading, + maximumAttenuation: value !== undefined ? parseFloat(value) : undefined + }); + }} + /> + + px + + + + + onChange('pointCloudShading', { + ...pointCloudShading, + eyeDomeLighting: event?.target?.checked + })} + > + + {' '}} /> + + + + + + + + onChange('pointCloudShading', { + ...pointCloudShading, + eyeDomeLightingStrength: value !== undefined ? parseFloat(value) : undefined + })} + /> + + + + + + + + onChange('pointCloudShading', { + ...pointCloudShading, + eyeDomeLightingRadius: value !== undefined ? parseFloat(value) : undefined + })} + /> + + + + ); +} + +PointCloudShadingSettings.propTypes = { + layer: PropTypes.object, + onChange: PropTypes.func +}; + +PointCloudShadingSettings.defaultProps = { + layer: {}, + onChange: () => {} +}; + +export default PointCloudShadingSettings; diff --git a/web/client/components/TOC/fragments/settings/ThreeDTilesSettings.jsx b/web/client/components/TOC/fragments/settings/ThreeDTilesSettings.jsx new file mode 100644 index 0000000000..3f5aa9f99f --- /dev/null +++ b/web/client/components/TOC/fragments/settings/ThreeDTilesSettings.jsx @@ -0,0 +1,88 @@ +/* + * Copyright 2023, GeoSolutions Sas. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + + +import React from 'react'; +import PropTypes from 'prop-types'; +import { FormGroup, ControlLabel, InputGroup } from 'react-bootstrap'; +import DebouncedFormControl from '../../../misc/DebouncedFormControl'; +import Message from '../../../I18N/Message'; +import PointCloudShadingSettings from './PointCloudShadingSettings'; +import Select from 'react-select'; + +/** + * ThreeDTilesSettings. This component shows the 3d tiles options available + * @prop {object} layer the layer options + * @prop {object} onChange callback on every on change event + */ +function ThreeDTilesSettings({ + layer, + onChange +}) { + if (layer?.type !== '3dtiles') { + return null; + } + return ( +
+ + + +