新增点位
This commit is contained in:
parent
691a59a84b
commit
5b56ecefea
@ -244,7 +244,8 @@ body {
|
|||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
padding: 22px 68px;
|
padding: 22px 68px;
|
||||||
position: relative;
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
border-bottom: 1px solid rgba(0,0,0,0.1);
|
border-bottom: 1px solid rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
|
@ -79,20 +79,12 @@ class BaseMap extends React.Component{
|
|||||||
map: new GaodeMap({
|
map: new GaodeMap({
|
||||||
pitch: 20,
|
pitch: 20,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 116.405285, 39.904989 ],
|
center: [ 118.405285, 39.904989 ],
|
||||||
zoom: 3
|
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({
|
this.setState({
|
||||||
map: scene,
|
map: scene,
|
||||||
pointDrawer: drawer,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -535,7 +527,35 @@ class BaseMap extends React.Component{
|
|||||||
}
|
}
|
||||||
|
|
||||||
enableDrawPoint = () => {
|
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 {
|
.selectWrap {
|
||||||
// width: 1393px;
|
|
||||||
// height: 102px;
|
|
||||||
background: rgba(239,240,248,0.7);
|
background: rgba(239,240,248,0.7);
|
||||||
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
|
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
|
||||||
border-radius: 10px 10px 10px 10px;
|
border-radius: 10px 10px 10px 10px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
margin: 3% 5%;
|
margin: 3% 5%;
|
||||||
|
margin-top: 8%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
Loading…
Reference in New Issue
Block a user