-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Junqiu Lei <[email protected]>
- Loading branch information
1 parent
fc0191c
commit 77a2e90
Showing
12 changed files
with
348 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/plugins/maps_dashboards/public/components/layer_config/base_map_layer_config_panel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiForm, EuiFormRow, EuiFieldText, EuiDualRange, EuiRange } from '@elastic/eui'; | ||
import { ILayerConfig } from '../../model/ILayerConfig'; | ||
|
||
interface Props { | ||
selectedLayerConfig: ILayerConfig; | ||
setSelectedLayerConfig: Function; | ||
} | ||
|
||
export const BaseMapLayerConfigPanel = ({ selectedLayerConfig, setSelectedLayerConfig }: Props) => { | ||
const onZoomChange = (value: number[]) => { | ||
setSelectedLayerConfig({ ...selectedLayerConfig, zoomRange: value }); | ||
}; | ||
|
||
const onOpacityChange = (e) => { | ||
setSelectedLayerConfig({ ...selectedLayerConfig, opacity: Number(e.target.value) }); | ||
}; | ||
|
||
const onNameChange = (e) => { | ||
setSelectedLayerConfig({ ...selectedLayerConfig, name: String(e.target.value) }); | ||
}; | ||
|
||
return ( | ||
<EuiForm> | ||
<EuiFormRow label="Name"> | ||
<EuiFieldText name="first" value={selectedLayerConfig.name} onChange={onNameChange} /> | ||
</EuiFormRow> | ||
<EuiFormRow label="Zoom"> | ||
<EuiDualRange | ||
min={0} | ||
max={22} | ||
value={selectedLayerConfig.zoomRange} | ||
onChange={onZoomChange} | ||
showInput | ||
minInputProps={{ 'aria-label': 'Min value' }} | ||
maxInputProps={{ 'aria-label': 'Max value' }} | ||
aria-label="EuiDualRange with inputs for zoom level" | ||
/> | ||
</EuiFormRow> | ||
<EuiFormRow label="Opacity"> | ||
<EuiRange | ||
min={0} | ||
max={1} | ||
step={0.1} | ||
value={selectedLayerConfig.opacity} | ||
onChange={onOpacityChange} | ||
showInput | ||
aria-label="EuiRange for layer opacity" | ||
/> | ||
</EuiFormRow> | ||
</EuiForm> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
...gins/maps_dashboards/public/components/layer_control_panel/MaplibreLayersPanelControl.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.