创建图层,创建点位优化

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 { } else {
createLayer({ //创建图层 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, logoImagePath: this.state.addLayer.logoImagePath,
name: this.state.addLayer.name, name: this.state.addLayer.name,
note: this.state.addLayer.note, note: this.state.addLayer.note,
@ -198,9 +200,9 @@ class LayerData extends React.Component {
} }
]}> ]}>
<Radio.Group id='redio-btn-group' onChange={this.onLayerIogoImagePathChange}> <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="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="icon02" className='radio-btn icon-02'></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="icon03" className='radio-btn icon-03'></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> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item label="图层备注"> <Form.Item label="图层备注">

View File

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