|
|
|
|
@ -11,7 +11,7 @@
|
|
|
|
|
import { defaultIcon,locateBack } from './svg';
|
|
|
|
|
import * as mars3d from 'mars3d';
|
|
|
|
|
import * as Cesium from 'mars3d-cesium';
|
|
|
|
|
import * as turf from '@turf/turf';
|
|
|
|
|
// import * as turf from '@turf/turf';
|
|
|
|
|
import { WktToGeojson, GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
|
|
|
|
|
import { useMessage } from '@/hooks/web/useMessage';
|
|
|
|
|
const { createMessage } = useMessage();
|
|
|
|
|
@ -266,25 +266,6 @@
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => props.showGeomData,
|
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
|
console.log('newVal',newVal)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deep: true,
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
watch(
|
|
|
|
|
() => props.geomType,
|
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
|
console.log('geomType',newVal)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deep: true,
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
function chooseWorkSpaceType() {
|
|
|
|
|
if(props.geomType == 'point'){
|
|
|
|
|
drawPoint()
|
|
|
|
|
@ -335,11 +316,8 @@
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
.then((graphic) => {
|
|
|
|
|
console.log('graphic',graphic)
|
|
|
|
|
let graphicJson = graphic.toJSON();
|
|
|
|
|
console.log('graphicJson',graphicJson)
|
|
|
|
|
let coordinates = [graphicJson.position[0],graphicJson.position[1]];
|
|
|
|
|
console.log('coordinates',coordinates)
|
|
|
|
|
let pos = GeojsonToWkt(turf.point(coordinates).geometry)
|
|
|
|
|
console.log('pos',pos)
|
|
|
|
|
emits('setNowShowData', pos)
|
|
|
|
|
@ -416,7 +394,6 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const addGeomLayers = (e) =>{
|
|
|
|
|
console.log('WktToGeojson(e.geom)',WktToGeojson(e.geom))
|
|
|
|
|
const coordinate = ref()
|
|
|
|
|
const lngLat = ref()
|
|
|
|
|
if(props.geomType == 'point'){
|
|
|
|
|
@ -431,7 +408,6 @@
|
|
|
|
|
coordinate.value = WktToGeojson(e.geom).coordinates[0]
|
|
|
|
|
lngLat.value = coordinate.value[0][0]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handlerLocation(lngLat.value);
|
|
|
|
|
let polygonGraphic = new mars3d.graphic.PolygonEntity({
|
|
|
|
|
id: e.gid,
|
|
|
|
|
@ -462,7 +438,6 @@
|
|
|
|
|
}
|
|
|
|
|
const addPointLayers = (e) =>{
|
|
|
|
|
const coordinate = WktToGeojson(e.geom).coordinates
|
|
|
|
|
console.log('coordinate',coordinate)
|
|
|
|
|
handlerLocation(coordinate);
|
|
|
|
|
const canvas = document.createElement('canvas');
|
|
|
|
|
canvas.width = 30;
|
|
|
|
|
@ -512,7 +487,6 @@
|
|
|
|
|
}
|
|
|
|
|
// 图斑定位
|
|
|
|
|
const handlerLocation = (lngLat) => {
|
|
|
|
|
console.log('lngLat',lngLat)
|
|
|
|
|
const position = Cesium.Cartesian3.fromDegrees(lngLat[0], lngLat[1]);
|
|
|
|
|
map.flyToPoint(position);
|
|
|
|
|
};
|
|
|
|
|
|