新增点位
This commit is contained in:
parent
691a59a84b
commit
5b56ecefea
@ -244,7 +244,8 @@ body {
|
||||
background: #FFFFFF;
|
||||
opacity: 1;
|
||||
padding: 22px 68px;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
border-bottom: 1px solid rgba(0,0,0,0.1);
|
||||
}
|
||||
|
@ -79,20 +79,12 @@ class BaseMap extends React.Component{
|
||||
map: new GaodeMap({
|
||||
pitch: 20,
|
||||
style: 'light',
|
||||
center: [ 116.405285, 39.904989 ],
|
||||
center: [ 118.405285, 39.904989 ],
|
||||
zoom: 3
|
||||
})
|
||||
});
|
||||
const drawer = new DrawPoint(scene, {});
|
||||
let newPointLocation = '';
|
||||
drawer.disable();
|
||||
drawer.on(DrawEvent.Add, (newPoint) => {
|
||||
newPointLocation = newPoint.geometry.coordinates.toString();
|
||||
this.showModal(newPointLocation);
|
||||
})
|
||||
this.setState({
|
||||
map: scene,
|
||||
pointDrawer: drawer,
|
||||
});
|
||||
}
|
||||
|
||||
@ -535,7 +527,35 @@ class BaseMap extends React.Component{
|
||||
}
|
||||
|
||||
enableDrawPoint = () => {
|
||||
this.state.pointDrawer.enable();
|
||||
this.state.map.addImage(
|
||||
'dingwei',
|
||||
'https://gw.alipayobjects.com/mdn/rms_3bf4aa/afts/img/A*JL46TZ_iYB0AAAAAAAAAAAAAARQnAQ',
|
||||
);
|
||||
const drawer = new DrawPoint(this.state.map, {
|
||||
style: {
|
||||
point: {
|
||||
normal: {
|
||||
shape: 'dingwei',
|
||||
size: 10,
|
||||
},
|
||||
hover: {
|
||||
shape: 'dingwei',
|
||||
size: 10,
|
||||
},
|
||||
active: {
|
||||
shape: 'dingwei',
|
||||
size: 10,
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
drawer.enable();
|
||||
drawer.on(DrawEvent.Add, (newPoint) => {
|
||||
this.showModal(newPoint.geometry.coordinates.toString());
|
||||
});
|
||||
this.setState({
|
||||
pointDrawer: drawer,
|
||||
});
|
||||
}
|
||||
|
||||
//弹出框事件
|
||||
|
@ -1,11 +1,10 @@
|
||||
.selectWrap {
|
||||
// width: 1393px;
|
||||
// height: 102px;
|
||||
background: rgba(239,240,248,0.7);
|
||||
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
opacity: 1;
|
||||
margin: 3% 5%;
|
||||
margin-top: 8%;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
width: 90%;
|
||||
|
Loading…
Reference in New Issue
Block a user