kopia lustrzana https://github.com/OpenDroneMap/WebODM
Add separator between layers
rodzic
3651a30f1d
commit
b809b4d396
|
@ -115,8 +115,10 @@ export default class LayersControlAnnotations extends React.Component {
|
||||||
componentDidUpdate(prevProps, prevState){
|
componentDidUpdate(prevProps, prevState){
|
||||||
if (prevState.visible !== this.state.visible){
|
if (prevState.visible !== this.state.visible){
|
||||||
this.annRefs.forEach(ann => {
|
this.annRefs.forEach(ann => {
|
||||||
let visible = this.state.visible ? ann.state.visible : false;
|
if (ann){
|
||||||
PluginsAPI.Map.toggleAnnotation(ann.props.layer, visible);
|
let visible = this.state.visible ? ann.state.visible : false;
|
||||||
|
PluginsAPI.Map.toggleAnnotation(ann.props.layer, visible);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,15 @@ export default class LayersControlLayer extends React.Component {
|
||||||
layer: null,
|
layer: null,
|
||||||
expanded: false,
|
expanded: false,
|
||||||
map: null,
|
map: null,
|
||||||
overlay: false
|
overlay: false,
|
||||||
|
separator: false,
|
||||||
};
|
};
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
layer: PropTypes.object.isRequired,
|
layer: PropTypes.object.isRequired,
|
||||||
expanded: PropTypes.bool,
|
expanded: PropTypes.bool,
|
||||||
map: PropTypes.object.isRequired,
|
map: PropTypes.object.isRequired,
|
||||||
overlay: PropTypes.bool
|
overlay: PropTypes.bool,
|
||||||
|
separator: PropTypes.bool
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props){
|
constructor(props){
|
||||||
|
@ -340,7 +342,7 @@ export default class LayersControlLayer extends React.Component {
|
||||||
|
|
||||||
return (<div className="layers-control-layer">
|
return (<div className="layers-control-layer">
|
||||||
<div className="layer-control-title">
|
<div className="layer-control-title">
|
||||||
{!this.props.overlay ? <ExpandButton bind={[this, 'expanded']} /> : <div className="paddingSpace"></div>}<Checkbox bind={[this, 'visible']}/>
|
{!this.props.overlay ? <ExpandButton bind={[this, 'expanded']} className="expand-layer" /> : <div className="paddingSpace"></div>}<Checkbox bind={[this, 'visible']}/>
|
||||||
<a title={meta.name} className="layer-label" href="javascript:void(0);" onClick={this.handleLayerClick}><i className={"layer-icon " + (meta.icon || "fa fa-vector-square fa-fw")}></i><div className="layer-title">{meta.name}</div></a> {meta.raster ? <a className="layer-action" href="javascript:void(0)" onClick={this.handleSideClick}><i title={_("Side By Side")} className={"fa fa-fw " + this.sideIcon()}></i></a> : ""}<a className="layer-action" href="javascript:void(0)" onClick={this.handleZoomToClick}><i title={_("Zoom To")} className="fa fa-expand"></i></a>
|
<a title={meta.name} className="layer-label" href="javascript:void(0);" onClick={this.handleLayerClick}><i className={"layer-icon " + (meta.icon || "fa fa-vector-square fa-fw")}></i><div className="layer-title">{meta.name}</div></a> {meta.raster ? <a className="layer-action" href="javascript:void(0)" onClick={this.handleSideClick}><i title={_("Side By Side")} className={"fa fa-fw " + this.sideIcon()}></i></a> : ""}<a className="layer-action" href="javascript:void(0)" onClick={this.handleZoomToClick}><i title={_("Zoom To")} className="fa fa-expand"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -414,6 +416,8 @@ export default class LayersControlLayer extends React.Component {
|
||||||
asset={this.asset}
|
asset={this.asset}
|
||||||
exportParams={this.getLayerParams}
|
exportParams={this.getLayerParams}
|
||||||
dropUp />
|
dropUp />
|
||||||
|
|
||||||
|
{this.props.separator ? <hr className="layer-separator" /> : ""}
|
||||||
</div> : ""}
|
</div> : ""}
|
||||||
</div>);
|
</div>);
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,13 @@ export default class LayersControlPanel extends React.Component {
|
||||||
const m_a = a[Symbol.for("meta")] || {};
|
const m_a = a[Symbol.for("meta")] || {};
|
||||||
const m_b = b[Symbol.for("meta")] || {};
|
const m_b = b[Symbol.for("meta")] || {};
|
||||||
return m_a.type > m_b.type ? -1 : 1;
|
return m_a.type > m_b.type ? -1 : 1;
|
||||||
}).map((layer, i) => <LayersControlLayer map={this.props.map} expanded={(layer[Symbol.for("meta")] || {}).autoExpand || false} overlay={false} layer={layer} key={`${i}-${(layer[Symbol.for("meta")] || {}).type}`} />)}
|
}).map((layer, i) => <LayersControlLayer map={this.props.map}
|
||||||
|
expanded={(layer[Symbol.for("meta")] || {}).autoExpand || false}
|
||||||
|
overlay={false}
|
||||||
|
layer={layer}
|
||||||
|
key={`${i}-${(layer[Symbol.for("meta")] || {}).type}`}
|
||||||
|
separator={i < group.layers.length - 1}
|
||||||
|
/>)}
|
||||||
</div>);
|
</div>);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -687,7 +687,7 @@ _('Example:'),
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.setState({showLoading: false, error: e.message});
|
this.setState({showLoading: false, error: e.message});
|
||||||
});
|
});
|
||||||
|
|
||||||
PluginsAPI.Map.triggerDidAddControls({
|
PluginsAPI.Map.triggerDidAddControls({
|
||||||
map: this.map,
|
map: this.map,
|
||||||
tiles: tiles,
|
tiles: tiles,
|
||||||
|
|
|
@ -35,14 +35,16 @@ class Toggle extends React.Component {
|
||||||
class Checkbox extends Toggle{
|
class Checkbox extends Toggle{
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
trueIcon: "far fa-check-square",
|
trueIcon: "far fa-check-square",
|
||||||
falseIcon: "far fa-square"
|
falseIcon: "far fa-square",
|
||||||
|
className: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExpandButton extends Toggle{
|
class ExpandButton extends Toggle{
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
trueIcon: "fa fa-caret-down",
|
trueIcon: "fa fa-caret-down",
|
||||||
falseIcon: "fa fa-caret-right"
|
falseIcon: "fa fa-caret-right",
|
||||||
|
className: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,15 @@
|
||||||
padding-right: 6px;
|
padding-right: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.expand-layer{
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr.layer-separator{
|
||||||
|
margin-top: 6px;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
select, input{
|
select, input{
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
|
Ładowanie…
Reference in New Issue