创建图层,创建点位优化

This commit is contained in:
licuizhu 2024-01-29 22:49:41 +08:00
parent 4fc73b14be
commit 39ae2cbdbe
2 changed files with 14 additions and 11 deletions

View File

@ -118,7 +118,9 @@ class LayerData extends React.Component {
})
} else {
createLayer({ //创建图层
id: this.state.addLayer.id,
// id: this.state.addLayer.id,
cityAdcode: this.props.adcode.cityAdcode,
districtAdcode: this.props.adcode.districtAdcode,
logoImagePath: this.state.addLayer.logoImagePath,
name: this.state.addLayer.name,
note: this.state.addLayer.note,
@ -198,9 +200,9 @@ class LayerData extends React.Component {
}
]}>
<Radio.Group id='redio-btn-group' onChange={this.onLayerIogoImagePathChange}>
<Radio.Button name='logoImagePath' value="icon01" className='radio-btn icon-01'></Radio.Button>
<Radio.Button name='logoImagePath' value="icon02" className='radio-btn icon-02'></Radio.Button>
<Radio.Button name='logoImagePath' value="icon03" className='radio-btn icon-03'></Radio.Button>
<Radio.Button name='logoImagePath' value="https://bamboo-mao.oss-cn-beijing.aliyuncs.com/icon/position_icon1_big.png" className='radio-btn icon-01'></Radio.Button>
<Radio.Button name='logoImagePath' value="https://bamboo-mao.oss-cn-beijing.aliyuncs.com/icon/position_icon2_big.png" className='radio-btn icon-02'></Radio.Button>
<Radio.Button name='logoImagePath' value="https://bamboo-mao.oss-cn-beijing.aliyuncs.com/icon/position_icon3_big.png" className='radio-btn icon-03'></Radio.Button>
</Radio.Group>
</Form.Item>
<Form.Item label="图层备注">

View File

@ -160,10 +160,10 @@ class BaseMap extends React.Component{
for (let i = 0; i < LabelsData.length; i++) {
icon = LabelsData[0].logoImage;
el = document.createElement('label');
el.style.width = '22px';
el.style.height = '22px';
el.style.width = '26px';
el.style.height = '26px';
el.style.background = 'url("' + icon + '") no-repeat';
el.style.backgroundSize = 'contain';
el.style.backgroundSize = 'cover';
marker = new Marker({
element: el
@ -594,12 +594,12 @@ class BaseMap extends React.Component{
"districtAdcode": this.state.districtAdcode,
"location": this.state.newPointLocation,
"provinceAdcode": this.state.provinceAdcode,
}).then((e) => {
}).then((e) => {
this.state.pointDrawer.removeActiveFeature();
this.state.pointDrawer.disable();
let layerId = this.state.pointAdd.layerId;
if (e.success) {
message.success(e.message || '成功!');
message.success('点位创建成功成功!');
setTimeout(() => {
this.getLayerPoints(layerId, true, 1);
this.refs.getLayerDataFun.changeUnitAmount(this.state.pointAdd.layerId);
@ -609,7 +609,7 @@ class BaseMap extends React.Component{
pointAdd: {},
});
} else {
message.error(e.message || '失败!');
message.error('点位创建失败!');
}
})
};
@ -707,7 +707,8 @@ class BaseMap extends React.Component{
</Row>
</Card>
{/* 图层数据显示 */}
<LayerData ref="getLayerDataFun" getLayerPoints = {this.getLayerPoints} getLayerShapes = {this.getLayerShapes}/>
<LayerData ref="getLayerDataFun" adcode={{cityAdcode: this.state.cityAdcode, districtAdcode: this.state.districtAdcode}}
getLayerPoints = {this.getLayerPoints} getLayerShapes = {this.getLayerShapes}/>
<div className={styles.btnRightWrap}>
<Button type="primary" className={styles.btnRight} onClick={this.enableDrawPoint}>点位创建</Button>
{/* <Button type='primary' danger className={styles.btnRight} onClick={() => this.state.pointDrawer?.disable()}>停止创建</Button> */}