Skip to content

Commit

Permalink
geosolutions-it#10374: Changing the layer's opacity in a Map View mak…
Browse files Browse the repository at this point in the history
…es MapStore crash

Description:
- fixing issue of crash app in change layer's opacity in map view
  • Loading branch information
mahmoudadel54 committed Jun 7, 2024
1 parent bc4aefc commit c14bb9f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Alert
} from 'react-bootstrap';
import Select from 'react-select';
import {clamp} from 'lodash';
import FormControl from '../../misc/DebouncedFormControl';
import { formatClippingFeatures } from '../../../utils/MapViewsUtils';
import Message from '../../I18N/Message';
Expand Down Expand Up @@ -104,7 +105,10 @@ function LayerOverridesNode({
className="opacity-field"
fallbackValue={1}
value={layer.opacity}
onChange={(value) => onChange({ opacity: value })}
onChange={(value) => {
const opacity = value && clamp(parseFloat(value), 0, 1);
onChange({ opacity: opacity || 0 });
}}
/>
</FormGroup>}
{isClippingSupported && <div className="ms-map-views-layer-clipping">
Expand Down

0 comments on commit c14bb9f

Please sign in to comment.