|
@@ -4,6 +4,7 @@ import { ElMessage } from 'element-plus'
|
|
|
import 'element-plus/es/components/message/style/css'
|
|
|
let bridge
|
|
|
let calculateFinish = false
|
|
|
+let drawGeometry
|
|
|
|
|
|
export function initBridge(){
|
|
|
bridge = new CityGis.Bridge({
|
|
@@ -259,38 +260,8 @@ export function draw(type){
|
|
|
bridge.Invoke(params);
|
|
|
bridge.addEventListener((arg) => {
|
|
|
if(arg.action == "DrawComplete"){
|
|
|
- // 地图标记
|
|
|
- if(this.componentsStatus.showMapMark){
|
|
|
- if(!arg.data.geometry){
|
|
|
- return
|
|
|
- }
|
|
|
- let data = arg.data.geometry
|
|
|
- let path = ''
|
|
|
- if(type == "point"){
|
|
|
- path = data.x.toFixed(2)+":"+data.y.toFixed(2)
|
|
|
- }else if(type == "polyline"){
|
|
|
- let paths = data.paths[0][0]
|
|
|
- for(let i in paths){
|
|
|
- path = paths[i][0]+":"+paths[i][1]+"/"
|
|
|
- }
|
|
|
- path = path.substring(0,path.length-1)
|
|
|
- }else if(type == "polygon"){
|
|
|
- let rings = data.rings[0][0]
|
|
|
- for(let i in rings){
|
|
|
- path = rings[i][0]+":"+rings[i][1]+"/"
|
|
|
- }
|
|
|
- path = path.substring(0,path.length-1)
|
|
|
- }
|
|
|
- this.$refs.divMark.setPath(path)
|
|
|
- }
|
|
|
- // 区域统计
|
|
|
- if(this.componentsStatus.showMapStatistics){
|
|
|
- if(!arg.data.geometry){
|
|
|
- return
|
|
|
- }
|
|
|
- this.$refs.divStatistics.setGeometry(arg.data.geometry)
|
|
|
- }
|
|
|
- return this.drawGeometry = arg.data.geometry
|
|
|
+
|
|
|
+ return drawGeometry = arg.data.geometry
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -332,7 +303,13 @@ export function setCamera(data){
|
|
|
bridge.Invoke(params);
|
|
|
}
|
|
|
|
|
|
-/*清空地图*/
|
|
|
+/**
|
|
|
+ * 清空地图
|
|
|
+ * 下面是支持的图层,可多选
|
|
|
+ * layers:['sketchLayer','bufferLayer','tempLayer','boatLayer','boatPathLayer']
|
|
|
+ * is_draw 对应图形绘制
|
|
|
+ * is_search 对应点查询和图形标记
|
|
|
+ * */
|
|
|
export function clearMap(data){
|
|
|
let params = {
|
|
|
"ActionName": "ClearMap",
|
|
@@ -347,5 +324,5 @@ export function clearMap(data){
|
|
|
}
|
|
|
|
|
|
export function getDrawGeometry(){
|
|
|
- return this.drawGeometry
|
|
|
+ return drawGeometry
|
|
|
}
|