diff --git a/.env.linyefanghuo b/.env.linyefanghuo
index 67ee871..19b13f4 100644
--- a/.env.linyefanghuo
+++ b/.env.linyefanghuo
@@ -12,13 +12,24 @@ VITE_BUILD_COMPRESS = 'none'
# Basic interface address SPA
# 天空地项目
-VITE_GLOB_API_URL=http://221.2.83.243:6060
-VITE_GLOB_INFO_IMAGE_URL=http://221.2.83.243:6060
+# .net
+VITE_GLOB_API_URL= http://221.2.83.243:6050/core
+
+# java
+VITE_GLOB_COFFEE_API_URL = http://221.2.83.243:6050/coffee
+
+# image
+VITE_GLOB_INFO_IMAGE_URL= http://221.2.83.243:6050/core
+
+# geoserver
+VITE_GLOB_GEOSERVER_BASE_URL = http://221.2.83.243:6050/
# File upload address, optional
# It can be forwarded by nginx or write the actual address directly
-VITE_GLOB_UPLOAD_URL=http://221.2.83.243:6060
+
+# file
+VITE_GLOB_UPLOAD_URL=http://221.2.83.243:6050/core
# Interface prefix
@@ -38,4 +49,4 @@ VITE_GLOB_YINGXIANG_SERVER = http://192.168.31.205:8080/geoserver/ne/wms?service
VITE_GLOB_FILE_PREVIEW = http://120.222.154.7:6081
-VITE_GLOB_API_URL_SITUATION = http://123.132.248.154:6033
+VITE_GLOB_API_URL_SITUATION = https://wrj.wisestcity.com:6034
diff --git a/components/Map/fire-user.png b/components/Map/fire-user.png
new file mode 100644
index 0000000..181afff
Binary files /dev/null and b/components/Map/fire-user.png differ
diff --git a/components/Map/navigation-end-point.png b/components/Map/navigation-end-point.png
new file mode 100644
index 0000000..62ebe24
Binary files /dev/null and b/components/Map/navigation-end-point.png differ
diff --git a/components/Map/navigation-start-point.png b/components/Map/navigation-start-point.png
new file mode 100644
index 0000000..42a4e04
Binary files /dev/null and b/components/Map/navigation-start-point.png differ
diff --git a/components/Weather/bingbao.png b/components/Weather/bingbao.png
new file mode 100644
index 0000000..9fed875
Binary files /dev/null and b/components/Weather/bingbao.png differ
diff --git a/components/Weather/lei.png b/components/Weather/lei.png
new file mode 100644
index 0000000..84821c9
Binary files /dev/null and b/components/Weather/lei.png differ
diff --git a/components/Weather/qing.png b/components/Weather/qing.png
new file mode 100644
index 0000000..3c8217f
Binary files /dev/null and b/components/Weather/qing.png differ
diff --git a/components/Weather/shachen.png b/components/Weather/shachen.png
new file mode 100644
index 0000000..36028fb
Binary files /dev/null and b/components/Weather/shachen.png differ
diff --git a/components/Weather/wind.png b/components/Weather/wind.png
new file mode 100644
index 0000000..50a0a85
Binary files /dev/null and b/components/Weather/wind.png differ
diff --git a/components/Weather/wind_one.png b/components/Weather/wind_one.png
new file mode 100644
index 0000000..2fd75d7
Binary files /dev/null and b/components/Weather/wind_one.png differ
diff --git a/components/Weather/wind_three.png b/components/Weather/wind_three.png
new file mode 100644
index 0000000..5f045fd
Binary files /dev/null and b/components/Weather/wind_three.png differ
diff --git a/components/Weather/wu.png b/components/Weather/wu.png
new file mode 100644
index 0000000..fc491da
Binary files /dev/null and b/components/Weather/wu.png differ
diff --git a/components/Weather/xue.png b/components/Weather/xue.png
new file mode 100644
index 0000000..724725a
Binary files /dev/null and b/components/Weather/xue.png differ
diff --git a/components/Weather/yin.png b/components/Weather/yin.png
new file mode 100644
index 0000000..19a7d88
Binary files /dev/null and b/components/Weather/yin.png differ
diff --git a/components/Weather/yu.png b/components/Weather/yu.png
new file mode 100644
index 0000000..64c3f60
Binary files /dev/null and b/components/Weather/yu.png differ
diff --git a/components/Weather/yun.png b/components/Weather/yun.png
new file mode 100644
index 0000000..ebd5a05
Binary files /dev/null and b/components/Weather/yun.png differ
diff --git a/package.json b/package.json
index 26e61a2..0f8f80e 100644
--- a/package.json
+++ b/package.json
@@ -85,7 +85,7 @@
"@microsoft/signalr": "^8.0.0",
"@shikijs/monaco": "^1.1.6",
"@terraformer/wkt": "2.1.2",
- "@turf/turf": "^7.1.0",
+ "@turf/turf": "^6.3.0",
"@vben/hooks": "workspace:*",
"@volar/cdn": "~1.11.1",
"@volar/monaco": "~1.11.1",
diff --git a/packages/mars3d.rar b/packages/mars3d.rar
new file mode 100644
index 0000000..3578b0e
Binary files /dev/null and b/packages/mars3d.rar differ
diff --git a/src/assets/images/chart/tasks/OnlineUsers.png b/src/assets/images/chart/tasks/OnlineUsers.png
new file mode 100644
index 0000000..578b9e3
Binary files /dev/null and b/src/assets/images/chart/tasks/OnlineUsers.png differ
diff --git a/src/assets/images/chart/tasks/fire-user.png b/src/assets/images/chart/tasks/fire-user.png
new file mode 100644
index 0000000..181afff
Binary files /dev/null and b/src/assets/images/chart/tasks/fire-user.png differ
diff --git a/src/assets/images/chart/tasks/measure/clear-draw.png b/src/assets/images/chart/tasks/measure/clear-draw.png
new file mode 100644
index 0000000..53f5d22
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/clear-draw.png differ
diff --git a/src/assets/images/chart/tasks/measure/gdc.png b/src/assets/images/chart/tasks/measure/gdc.png
new file mode 100644
index 0000000..9848b12
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/gdc.png differ
diff --git a/src/assets/images/chart/tasks/measure/jiaodu.png b/src/assets/images/chart/tasks/measure/jiaodu.png
new file mode 100644
index 0000000..f4faf1e
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/jiaodu.png differ
diff --git a/src/assets/images/chart/tasks/measure/kjjl.png b/src/assets/images/chart/tasks/measure/kjjl.png
new file mode 100644
index 0000000..aa189bf
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/kjjl.png differ
diff --git a/src/assets/images/chart/tasks/measure/paomian.png b/src/assets/images/chart/tasks/measure/paomian.png
new file mode 100644
index 0000000..59cee35
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/paomian.png differ
diff --git a/src/assets/images/chart/tasks/measure/sanjiao.png b/src/assets/images/chart/tasks/measure/sanjiao.png
new file mode 100644
index 0000000..f2c6aa5
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/sanjiao.png differ
diff --git a/src/assets/images/chart/tasks/measure/spmj.png b/src/assets/images/chart/tasks/measure/spmj.png
new file mode 100644
index 0000000..4d64ee2
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/spmj.png differ
diff --git a/src/assets/images/chart/tasks/measure/tdjl.png b/src/assets/images/chart/tasks/measure/tdjl.png
new file mode 100644
index 0000000..2e62ab5
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/tdjl.png differ
diff --git a/src/assets/images/chart/tasks/measure/tiedi.png b/src/assets/images/chart/tasks/measure/tiedi.png
new file mode 100644
index 0000000..6762b1b
Binary files /dev/null and b/src/assets/images/chart/tasks/measure/tiedi.png differ
diff --git a/src/assets/images/chart/tasks/to-top.png b/src/assets/images/chart/tasks/to-top.png
new file mode 100644
index 0000000..e6a23b4
Binary files /dev/null and b/src/assets/images/chart/tasks/to-top.png differ
diff --git a/src/assets/images/chart/zhigan/component/cloud-control.png b/src/assets/images/chart/zhigan/component/cloud-control.png
new file mode 100644
index 0000000..329f570
Binary files /dev/null and b/src/assets/images/chart/zhigan/component/cloud-control.png differ
diff --git a/src/packages/components/Charts/Maps/MapLayer/index.vue b/src/packages/components/Charts/Maps/MapLayer/index.vue
index 6fa67c1..50f32ee 100644
--- a/src/packages/components/Charts/Maps/MapLayer/index.vue
+++ b/src/packages/components/Charts/Maps/MapLayer/index.vue
@@ -49,6 +49,11 @@ import * as mars3d from "mars3d";
import { option } from '@/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/barOptions'
import { EventBus } from '@/utils/eventBus';
+
+import { getAppEnvConfig } from '@/utils/env'
+var { VITE_GLOB_GEOSERVER_BASE_URL,VITE_GLOB_COFFEE_API_URL } = getAppEnvConfig();
+
+
const chartEditStore = useChartEditStore();
let map: mars3d.Map; // 地图对象
@@ -65,10 +70,16 @@ const layers = ref(null)
const handlerLayers:any = ref([]);
const handlerGetLayerTree = ()=>{
- axios.get('http://221.2.83.254:9006/applicationMars/getApplicationInfo/feixian').then((res)=>{
+
+ axios.get(VITE_GLOB_COFFEE_API_URL+'/applicationMars/getApplicationInfo/feixian',{
+ headers:{
+ "X-Token":localStorage.getItem("X-Token")
+ }
+ }).then((res)=>{
layers.value = res.data.data
let configLayers = [];
- let GEOSERVER_BASE_API = "http://221.2.83.254:9007/";
+ // let GEOSERVER_BASE_API = "http://221.2.83.254:9007/";
+ let GEOSERVER_BASE_API = VITE_GLOB_GEOSERVER_BASE_URL;
res.data.data.forEach((item, index) => {
let group:Object;
group = {
@@ -220,6 +231,11 @@ const handlerGetLayerTree = ()=>{
attribute.show = attribute.show ? true : false;
+
+ attribute.headers = {
+ 'X-Token': localStorage.getItem('X-Token'),
+ }
+
layerGroup.children.push(attribute);
});
}
diff --git a/src/packages/components/Charts/Maps/MapMars3d/index.vue b/src/packages/components/Charts/Maps/MapMars3d/index.vue
index 3e5484a..9754792 100644
--- a/src/packages/components/Charts/Maps/MapMars3d/index.vue
+++ b/src/packages/components/Charts/Maps/MapMars3d/index.vue
@@ -1,9 +1,51 @@
-
+
+
+
+
+
+
+
diff --git a/src/packages/components/Charts/Maps/MapMars3d/lib/CoordinateTransform.ts b/src/packages/components/Charts/Maps/MapMars3d/lib/CoordinateTransform.ts
new file mode 100644
index 0000000..caf16f4
--- /dev/null
+++ b/src/packages/components/Charts/Maps/MapMars3d/lib/CoordinateTransform.ts
@@ -0,0 +1,93 @@
+const PI = Math.PI
+const a = 6378245.0
+const ee = 0.00669342162296594323
+
+function outOfChina(lng, lat) {
+ return (
+ lng < 72.004 || lng > 137.8347 ||
+ lat < 0.8293 || lat > 55.8271
+ )
+}
+
+function transformLat(x, y) {
+ let ret =
+ -100.0 +
+ 2.0 * x +
+ 3.0 * y +
+ 0.2 * y * y +
+ 0.1 * x * y +
+ 0.2 * Math.sqrt(Math.abs(x))
+ ret +=
+ ((20.0 * Math.sin(6.0 * x * PI) +
+ 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
+ ret +=
+ ((20.0 * Math.sin(y * PI) +
+ 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0
+ ret +=
+ ((160.0 * Math.sin((y / 12.0) * PI) +
+ 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0
+ return ret
+}
+
+function transformLng(x, y) {
+ let ret =
+ 300.0 +
+ x +
+ 2.0 * y +
+ 0.1 * x * x +
+ 0.1 * x * y +
+ 0.1 * Math.sqrt(Math.abs(x))
+ ret +=
+ ((20.0 * Math.sin(6.0 * x * PI) +
+ 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
+ ret +=
+ ((20.0 * Math.sin(x * PI) +
+ 40.0 * Math.sin((x / 3.0) * PI)) * 2.0) / 3.0
+ ret +=
+ ((150.0 * Math.sin((x / 12.0) * PI) +
+ 300.0 * Math.sin((x / 30.0) * PI)) * 2.0) / 3.0
+ return ret
+}
+
+
+export function wgs84ToGcj02(lng, lat) {
+ if (outOfChina(lng, lat)) {
+ return [lng, lat]
+ }
+
+ let dLat = transformLat(lng - 105.0, lat - 35.0)
+ let dLng = transformLng(lng - 105.0, lat - 35.0)
+
+ const radLat = lat / 180.0 * PI
+ let magic = Math.sin(radLat)
+ magic = 1 - ee * magic * magic
+ const sqrtMagic = Math.sqrt(magic)
+
+ dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * PI)
+ dLng = (dLng * 180.0) / (a / sqrtMagic * Math.cos(radLat) * PI)
+
+ return [lng + dLng, lat + dLat]
+ }
+
+
+export function gcj02ToWgs84(lng, lat) {
+ if (outOfChina(lng, lat)) {
+ return [lng, lat]
+ }
+
+ let dLat = transformLat(lng - 105.0, lat - 35.0)
+ let dLng = transformLng(lng - 105.0, lat - 35.0)
+
+ const radLat = lat / 180.0 * PI
+ let magic = Math.sin(radLat)
+ magic = 1 - ee * magic * magic
+ const sqrtMagic = Math.sqrt(magic)
+
+ dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * PI)
+ dLng = (dLng * 180.0) / (a / sqrtMagic * Math.cos(radLat) * PI)
+
+ const mgLat = lat + dLat
+ const mgLng = lng + dLng
+
+ return [lng * 2 - mgLng, lat * 2 - mgLat]
+ }
\ No newline at end of file
diff --git a/src/packages/components/Charts/Maps/MapMars3d/lib/getWeather.ts b/src/packages/components/Charts/Maps/MapMars3d/lib/getWeather.ts
new file mode 100644
index 0000000..0a3cc49
--- /dev/null
+++ b/src/packages/components/Charts/Maps/MapMars3d/lib/getWeather.ts
@@ -0,0 +1,53 @@
+import axios from 'axios'
+
+export const getWeather = ()=>{
+ return new Promise((resolve,reject)=>{
+ try{
+ // 易客云天气API http://yiketianqi.com/
+ axios({
+ method: 'get',
+ url:"http://v1.yiketianqi.com/api?unescape=1&version=v61&appid=45239454&appsecret=yZrOL1nv&city=费县",
+ }).then((res) => {
+ resolve(res.data);
+ }).catch(e=>{
+ reject(null);
+ });
+ }catch(e){
+ reject(null);
+ }
+ })
+}
+
+export const getWindDegree = (type)=>{
+ let degree = 0;
+ switch(type){
+ case "东风":
+ degree = 90;
+ break;
+ case "南风":
+ degree = 0;
+ break;
+ case "西风":
+ degree = 270;
+ break;
+ case "北风":
+ degree = 180;
+ break;
+ case "东北风":
+ degree = 135;
+ break;
+ case "东南风":
+ degree = 45;
+ break;
+ case "西北风":
+ degree = 225;
+ break;
+ case "西南风":
+ degree = 315;
+ break;
+ default:
+ degree = null;
+ break;
+ }
+ return degree;
+}
\ No newline at end of file
diff --git a/src/packages/components/Charts/Maps/Navigation/index.vue b/src/packages/components/Charts/Maps/Navigation/index.vue
index 49f8367..81dc8fc 100644
--- a/src/packages/components/Charts/Maps/Navigation/index.vue
+++ b/src/packages/components/Charts/Maps/Navigation/index.vue
@@ -43,10 +43,12 @@ import { MarkerEnum, ThemeEnum } from './config'
import { isArray } from '@/utils';
import axios from 'axios';
import { CaretDownOutlined, StarFilled, StarTwoTone,CheckOutlined,CaretRightOutlined } from '@ant-design/icons-vue';
-
+import { getAppEnvConfig } from '@/utils/env'
import * as mars3d from "mars3d";
import { option } from '@/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/barOptions'
+var { VITE_GLOB_GEOSERVER_BASE_URL,VITE_GLOB_COFFEE_API_URL } = getAppEnvConfig();
+
let map: mars3d.Map; // 地图对象
@@ -66,11 +68,17 @@ const handlerLayers = ref([]);
const handlerGetLayerTree = ()=>{
- axios.get('http://221.2.83.254:9006/applicationMars/getApplicationInfo/feixian').then((res)=>{
+ axios.get(VITE_GLOB_COFFEE_API_URL+'/applicationMars/getApplicationInfo/feixian',{
+ headers:{
+ "X-Token":localStorage.getItem("X-Token")
+ }
+ }).then((res)=>{
layers.value = res.data.data
console.log("res",layers.value);
let configLayers = [];
+
let GEOSERVER_BASE_API = "http://221.2.83.254:9007/";
+
res.data.data.forEach((item, index) => {
let group = null;
group = {
diff --git a/src/packages/components/Tasks/Tasks/LocationSearch/config.ts b/src/packages/components/Tasks/Tasks/LocationSearch/config.ts
new file mode 100644
index 0000000..2cbaaac
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/LocationSearch/config.ts
@@ -0,0 +1,18 @@
+import { PublicConfigClass } from '@/packages/public'
+import { chartInitConfig } from '@/settings/designSetting'
+import { CreateComponentType } from '@/packages/index.d'
+import { LocationSearchConfig } from './index'
+import cloneDeep from 'lodash/cloneDeep'
+
+export const option = {
+ textSize: 14,
+ colors: ['#0C2411','#00611A','#FFFFFF'],
+ text: '添加途经点'
+}
+
+export default class Config extends PublicConfigClass implements CreateComponentType {
+ public key = LocationSearchConfig.key
+ public attr = { ...chartInitConfig, w:400, h: 400, zIndex: 1 }
+ public chartConfig = cloneDeep(LocationSearchConfig)
+ public option = cloneDeep(option)
+}
diff --git a/src/packages/components/Tasks/Tasks/LocationSearch/config.vue b/src/packages/components/Tasks/Tasks/LocationSearch/config.vue
new file mode 100644
index 0000000..072021d
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/LocationSearch/config.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 恢复默认
+
+
+
+
+
+
+
diff --git a/src/packages/components/Tasks/Tasks/LocationSearch/drag.ts b/src/packages/components/Tasks/Tasks/LocationSearch/drag.ts
new file mode 100644
index 0000000..2b3fe7b
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/LocationSearch/drag.ts
@@ -0,0 +1,100 @@
+// drag.js
+export default {
+ mounted(el) {
+ // 设置为相对于窗口定位
+ el.style.position = 'fixed'
+
+ const getBounds = () => ({
+ wMax: window.innerWidth - el.offsetWidth,
+ hMax: window.innerHeight - el.offsetHeight
+ })
+
+ if ('ontouchstart' in window) {
+ // 移动端
+ el.ontouchstart = (e) => {
+ const time1 = Date.now()
+ const rect = el.getBoundingClientRect()
+ const startX = e.touches[0].clientX
+ const startY = e.touches[0].clientY
+ const offsetX = startX - rect.left
+ const offsetY = startY - rect.top
+
+ const { wMax, hMax } = getBounds()
+
+ document.ontouchmove = (e) => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-inactive')
+ el.classList.add('v-drag-active')
+ }
+
+ let left = e.touches[0].clientX - offsetX
+ let top = e.touches[0].clientY - offsetY
+
+ if (left < 0) left = 0
+ else if (left > wMax) left = wMax
+
+ if (top < 0) top = 0
+ else if (top > hMax) top = hMax
+
+ el.style.left = `${left}px`
+ el.style.top = `${top}px`
+ }
+
+ document.ontouchend = () => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-active')
+ el.classList.add('v-drag-inactive')
+ }
+ document.ontouchmove = document.ontouchend = null
+ }
+ }
+ } else {
+ // PC端
+ el.onmousedown = (e) => {
+ const time1 = Date.now()
+ const rect = el.getBoundingClientRect()
+ const offsetX = e.clientX - rect.left
+ const offsetY = e.clientY - rect.top
+
+ const { wMax, hMax } = getBounds()
+
+ document.onmousemove = (e) => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-inactive')
+ el.classList.add('v-drag-active')
+ }
+
+ let left = e.clientX - offsetX
+ let top = e.clientY - offsetY
+
+ if (left < 0) left = 0
+ else if (left > wMax) left = wMax
+
+ if (top < 0) top = 0
+ else if (top > hMax) top = hMax
+
+ el.style.left = `${left}px`
+ el.style.top = `${top}px`
+ }
+
+ document.onmouseup = () => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-active')
+ el.classList.add('v-drag-inactive')
+ }
+ document.onmousemove = document.onmouseup = null
+ }
+ }
+ }
+ },
+
+ unmounted(el) {
+ el.onmousedown = null
+ el.ontouchstart = null
+ }
+ }
+
\ No newline at end of file
diff --git a/src/packages/components/Tasks/Tasks/LocationSearch/index.ts b/src/packages/components/Tasks/Tasks/LocationSearch/index.ts
new file mode 100644
index 0000000..3d6b837
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/LocationSearch/index.ts
@@ -0,0 +1,14 @@
+import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d';
+import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d';
+
+export const LocationSearchConfig: ConfigType = {
+ key: 'LocationSearch',
+ chartKey: 'VLocationSearch',
+ conKey: 'VCLocationSearch',
+ title: '地点搜索',
+ category: ChatCategoryEnum.TITLE,
+ categoryName: ChatCategoryEnumName.TITLE,
+ package: PackagesCategoryEnum.TASKS,
+ chartFrame: ChartFrameEnum.STATIC,
+ image: 'LocationSearch.png',
+};
diff --git a/src/packages/components/Tasks/Tasks/LocationSearch/index.vue b/src/packages/components/Tasks/Tasks/LocationSearch/index.vue
new file mode 100644
index 0000000..e1f3b0a
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/LocationSearch/index.vue
@@ -0,0 +1,242 @@
+
+
+
+
+
+
+
+
diff --git a/src/packages/components/Tasks/Tasks/MeasureTools/config.ts b/src/packages/components/Tasks/Tasks/MeasureTools/config.ts
new file mode 100644
index 0000000..f2ddf9a
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/MeasureTools/config.ts
@@ -0,0 +1,18 @@
+import { PublicConfigClass } from '@/packages/public'
+import { chartInitConfig } from '@/settings/designSetting'
+import { CreateComponentType } from '@/packages/index.d'
+import { MeasureToolsConfig } from './index'
+import cloneDeep from 'lodash/cloneDeep'
+
+export const option = {
+ textSize: 14,
+ colors: ['#0C2411','#00611A','#FFFFFF'],
+ text: '添加途经点'
+}
+
+export default class Config extends PublicConfigClass implements CreateComponentType {
+ public key = MeasureToolsConfig.key
+ public attr = { ...chartInitConfig, w:400, h: 400, zIndex: 1 }
+ public chartConfig = cloneDeep(MeasureToolsConfig)
+ public option = cloneDeep(option)
+}
diff --git a/src/packages/components/Tasks/Tasks/MeasureTools/config.vue b/src/packages/components/Tasks/Tasks/MeasureTools/config.vue
new file mode 100644
index 0000000..072021d
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/MeasureTools/config.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 恢复默认
+
+
+
+
+
+
+
diff --git a/src/packages/components/Tasks/Tasks/MeasureTools/drag.ts b/src/packages/components/Tasks/Tasks/MeasureTools/drag.ts
new file mode 100644
index 0000000..2b3fe7b
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/MeasureTools/drag.ts
@@ -0,0 +1,100 @@
+// drag.js
+export default {
+ mounted(el) {
+ // 设置为相对于窗口定位
+ el.style.position = 'fixed'
+
+ const getBounds = () => ({
+ wMax: window.innerWidth - el.offsetWidth,
+ hMax: window.innerHeight - el.offsetHeight
+ })
+
+ if ('ontouchstart' in window) {
+ // 移动端
+ el.ontouchstart = (e) => {
+ const time1 = Date.now()
+ const rect = el.getBoundingClientRect()
+ const startX = e.touches[0].clientX
+ const startY = e.touches[0].clientY
+ const offsetX = startX - rect.left
+ const offsetY = startY - rect.top
+
+ const { wMax, hMax } = getBounds()
+
+ document.ontouchmove = (e) => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-inactive')
+ el.classList.add('v-drag-active')
+ }
+
+ let left = e.touches[0].clientX - offsetX
+ let top = e.touches[0].clientY - offsetY
+
+ if (left < 0) left = 0
+ else if (left > wMax) left = wMax
+
+ if (top < 0) top = 0
+ else if (top > hMax) top = hMax
+
+ el.style.left = `${left}px`
+ el.style.top = `${top}px`
+ }
+
+ document.ontouchend = () => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-active')
+ el.classList.add('v-drag-inactive')
+ }
+ document.ontouchmove = document.ontouchend = null
+ }
+ }
+ } else {
+ // PC端
+ el.onmousedown = (e) => {
+ const time1 = Date.now()
+ const rect = el.getBoundingClientRect()
+ const offsetX = e.clientX - rect.left
+ const offsetY = e.clientY - rect.top
+
+ const { wMax, hMax } = getBounds()
+
+ document.onmousemove = (e) => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-inactive')
+ el.classList.add('v-drag-active')
+ }
+
+ let left = e.clientX - offsetX
+ let top = e.clientY - offsetY
+
+ if (left < 0) left = 0
+ else if (left > wMax) left = wMax
+
+ if (top < 0) top = 0
+ else if (top > hMax) top = hMax
+
+ el.style.left = `${left}px`
+ el.style.top = `${top}px`
+ }
+
+ document.onmouseup = () => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-active')
+ el.classList.add('v-drag-inactive')
+ }
+ document.onmousemove = document.onmouseup = null
+ }
+ }
+ }
+ },
+
+ unmounted(el) {
+ el.onmousedown = null
+ el.ontouchstart = null
+ }
+ }
+
\ No newline at end of file
diff --git a/src/packages/components/Tasks/Tasks/MeasureTools/index.ts b/src/packages/components/Tasks/Tasks/MeasureTools/index.ts
new file mode 100644
index 0000000..7b95ae9
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/MeasureTools/index.ts
@@ -0,0 +1,14 @@
+import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d';
+import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d';
+
+export const MeasureToolsConfig: ConfigType = {
+ key: 'MeasureTools',
+ chartKey: 'VMeasureTools',
+ conKey: 'VCMeasureTools',
+ title: '测量工具',
+ category: ChatCategoryEnum.TITLE,
+ categoryName: ChatCategoryEnumName.TITLE,
+ package: PackagesCategoryEnum.TASKS,
+ chartFrame: ChartFrameEnum.STATIC,
+ image: 'MeasureTools.png',
+};
diff --git a/src/packages/components/Tasks/Tasks/MeasureTools/index.vue b/src/packages/components/Tasks/Tasks/MeasureTools/index.vue
new file mode 100644
index 0000000..c3ab33e
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/MeasureTools/index.vue
@@ -0,0 +1,444 @@
+
+
+
+
+
+
+
+
diff --git a/src/packages/components/Tasks/Tasks/OnlineUsers/config.ts b/src/packages/components/Tasks/Tasks/OnlineUsers/config.ts
new file mode 100644
index 0000000..2f5495c
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/OnlineUsers/config.ts
@@ -0,0 +1,18 @@
+import { PublicConfigClass } from '@/packages/public'
+import { chartInitConfig } from '@/settings/designSetting'
+import { CreateComponentType } from '@/packages/index.d'
+import { OnlineUsersConfig } from './index'
+import cloneDeep from 'lodash/cloneDeep'
+
+export const option = {
+ textSize: 14,
+ colors: ['#0C2411','#00611A','#FFFFFF'],
+ text: '添加途经点'
+}
+
+export default class Config extends PublicConfigClass implements CreateComponentType {
+ public key = OnlineUsersConfig.key
+ public attr = { ...chartInitConfig, w:400, h: 400, zIndex: 1 }
+ public chartConfig = cloneDeep(OnlineUsersConfig)
+ public option = cloneDeep(option)
+}
diff --git a/src/packages/components/Tasks/Tasks/OnlineUsers/config.vue b/src/packages/components/Tasks/Tasks/OnlineUsers/config.vue
new file mode 100644
index 0000000..072021d
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/OnlineUsers/config.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 恢复默认
+
+
+
+
+
+
+
diff --git a/src/packages/components/Tasks/Tasks/OnlineUsers/drag.ts b/src/packages/components/Tasks/Tasks/OnlineUsers/drag.ts
new file mode 100644
index 0000000..2b3fe7b
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/OnlineUsers/drag.ts
@@ -0,0 +1,100 @@
+// drag.js
+export default {
+ mounted(el) {
+ // 设置为相对于窗口定位
+ el.style.position = 'fixed'
+
+ const getBounds = () => ({
+ wMax: window.innerWidth - el.offsetWidth,
+ hMax: window.innerHeight - el.offsetHeight
+ })
+
+ if ('ontouchstart' in window) {
+ // 移动端
+ el.ontouchstart = (e) => {
+ const time1 = Date.now()
+ const rect = el.getBoundingClientRect()
+ const startX = e.touches[0].clientX
+ const startY = e.touches[0].clientY
+ const offsetX = startX - rect.left
+ const offsetY = startY - rect.top
+
+ const { wMax, hMax } = getBounds()
+
+ document.ontouchmove = (e) => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-inactive')
+ el.classList.add('v-drag-active')
+ }
+
+ let left = e.touches[0].clientX - offsetX
+ let top = e.touches[0].clientY - offsetY
+
+ if (left < 0) left = 0
+ else if (left > wMax) left = wMax
+
+ if (top < 0) top = 0
+ else if (top > hMax) top = hMax
+
+ el.style.left = `${left}px`
+ el.style.top = `${top}px`
+ }
+
+ document.ontouchend = () => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-active')
+ el.classList.add('v-drag-inactive')
+ }
+ document.ontouchmove = document.ontouchend = null
+ }
+ }
+ } else {
+ // PC端
+ el.onmousedown = (e) => {
+ const time1 = Date.now()
+ const rect = el.getBoundingClientRect()
+ const offsetX = e.clientX - rect.left
+ const offsetY = e.clientY - rect.top
+
+ const { wMax, hMax } = getBounds()
+
+ document.onmousemove = (e) => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-inactive')
+ el.classList.add('v-drag-active')
+ }
+
+ let left = e.clientX - offsetX
+ let top = e.clientY - offsetY
+
+ if (left < 0) left = 0
+ else if (left > wMax) left = wMax
+
+ if (top < 0) top = 0
+ else if (top > hMax) top = hMax
+
+ el.style.left = `${left}px`
+ el.style.top = `${top}px`
+ }
+
+ document.onmouseup = () => {
+ const time2 = Date.now()
+ if (time2 - time1 > 300) {
+ el.classList.remove('v-drag-active')
+ el.classList.add('v-drag-inactive')
+ }
+ document.onmousemove = document.onmouseup = null
+ }
+ }
+ }
+ },
+
+ unmounted(el) {
+ el.onmousedown = null
+ el.ontouchstart = null
+ }
+ }
+
\ No newline at end of file
diff --git a/src/packages/components/Tasks/Tasks/OnlineUsers/index.ts b/src/packages/components/Tasks/Tasks/OnlineUsers/index.ts
new file mode 100644
index 0000000..a85c631
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/OnlineUsers/index.ts
@@ -0,0 +1,14 @@
+import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d';
+import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d';
+
+export const OnlineUsersConfig: ConfigType = {
+ key: 'OnlineUsers',
+ chartKey: 'VOnlineUsers',
+ conKey: 'VCOnlineUsers',
+ title: '在线人员',
+ category: ChatCategoryEnum.TITLE,
+ categoryName: ChatCategoryEnumName.TITLE,
+ package: PackagesCategoryEnum.TASKS,
+ chartFrame: ChartFrameEnum.STATIC,
+ image: 'OnlineUsers.png',
+};
diff --git a/src/packages/components/Tasks/Tasks/OnlineUsers/index.vue b/src/packages/components/Tasks/Tasks/OnlineUsers/index.vue
new file mode 100644
index 0000000..401db79
--- /dev/null
+++ b/src/packages/components/Tasks/Tasks/OnlineUsers/index.vue
@@ -0,0 +1,714 @@
+
+
+
+
在线人员
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+ {{item?.unitName}}
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+ {{ item.name }}
+

+
+
+ 类型:{{ item.type }}
+
+
+ 电话:{{ item.phone }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/packages/components/Tasks/Tasks/TaskAssign/drag.ts b/src/packages/components/Tasks/Tasks/TaskAssign/drag.ts
index 8223c79..6ce7e5c 100644
--- a/src/packages/components/Tasks/Tasks/TaskAssign/drag.ts
+++ b/src/packages/components/Tasks/Tasks/TaskAssign/drag.ts
@@ -1,38 +1,61 @@
-// drag.js
-export default {
- mounted(el) {
- // 设置为相对父元素定位
- el.style.position = 'absolute'
+// drag.ts
+interface DragElement extends HTMLElement {
+ style: CSSStyleDeclaration;
+ offsetParent: HTMLElement;
+ offsetWidth: number;
+ offsetHeight: number;
+}
- const getBounds = () => {
- const parent = el.offsetParent || document.body
+interface Bounds {
+ parent: HTMLElement;
+ wMax: number;
+ hMax: number;
+ rect: DOMRect;
+}
+
+interface TouchEventWithTouches extends TouchEvent {
+ touches: TouchList;
+}
+
+interface MouseEventWithClient extends MouseEvent {
+ clientX: number;
+ clientY: number;
+}
+
+const dragDirective = {
+ mounted(el: DragElement): void {
+ // 设置为相对父元素定位
+ el.style.position = 'absolute';
+
+ const getBounds = (): Bounds => {
+ const parent = el.offsetParent || document.body;
return {
parent,
// 计算父容器的可见范围
wMax: parent.clientWidth - el.offsetWidth,
hMax: parent.clientHeight - el.offsetHeight,
rect: parent.getBoundingClientRect()
- }
- }
+ };
+ };
if ('ontouchstart' in window) {
// 移动端
- el.ontouchstart = (e) => {
- const time1 = Date.now()
- const rect = el.getBoundingClientRect()
- const { parent, wMax, hMax, rect: parentRect } = getBounds()
- const offsetX = e.touches[0].clientX - rect.left
- const offsetY = e.touches[0].clientY - rect.top
+ el.ontouchstart = (e: TouchEventWithTouches) => {
+ const time1 = Date.now();
+ const rect = el.getBoundingClientRect();
+ const { parent, wMax, hMax, rect: parentRect } = getBounds();
+ const offsetX = e.touches[0].clientX - rect.left;
+ const offsetY = e.touches[0].clientY - rect.top;
- document.ontouchmove = (e) => {
- const time2 = Date.now()
+ document.ontouchmove = (e: TouchEventWithTouches) => {
+ const time2 = Date.now();
if (time2 - time1 > 300) {
- el.classList.add('v-drag-active')
+ el.classList.add('v-drag-active');
}
// 相对于父容器左上角计算位置
- let left = e.touches[0].clientX - parentRect.left - offsetX
- let top = e.touches[0].clientY - parentRect.top - offsetY
+ let left = e.touches[0].clientX - parentRect.left - offsetX;
+ let top = e.touches[0].clientY - parentRect.top - offsetY;
// 可选:限制边界,不想限制就注释掉
// if (left < 0) left = 0
@@ -40,33 +63,34 @@ export default {
// if (top < 0) top = 0
// else if (top > hMax) top = hMax
- el.style.left = `${left}px`
- el.style.top = `${top}px`
- }
+ el.style.left = `${left}px`;
+ el.style.top = `${top}px`;
+ };
- document.ontouchend = () => {
- el.classList.remove('v-drag-active')
- document.ontouchmove = document.ontouchend = null
- }
- }
+ document.ontouchend = (): void => {
+ el.classList.remove('v-drag-active');
+ document.ontouchmove = null;
+ document.ontouchend = null;
+ };
+ };
} else {
// PC端
- el.onmousedown = (e) => {
- const time1 = Date.now()
- const rect = el.getBoundingClientRect()
- const { parent, wMax, hMax, rect: parentRect } = getBounds()
- const offsetX = e.clientX - rect.left
- const offsetY = e.clientY - rect.top
+ el.onmousedown = (e: MouseEventWithClient) => {
+ const time1 = Date.now();
+ const rect = el.getBoundingClientRect();
+ const { parent, wMax, hMax, rect: parentRect } = getBounds();
+ const offsetX = e.clientX - rect.left;
+ const offsetY = e.clientY - rect.top;
- document.onmousemove = (e) => {
- const time2 = Date.now()
+ document.onmousemove = (e: MouseEventWithClient) => {
+ const time2 = Date.now();
if (time2 - time1 > 300) {
- el.classList.add('v-drag-active')
+ el.classList.add('v-drag-active');
}
// 👇计算相对于父元素的位置,但用窗口坐标保证能拖出
- let left = e.clientX - parentRect.left - offsetX
- let top = e.clientY - parentRect.top - offsetY
+ let left = e.clientX - parentRect.left - offsetX;
+ let top = e.clientY - parentRect.top - offsetY;
// ✅允许超出父容器,所以不限制范围
// 想加边界限制可打开注释
@@ -75,20 +99,23 @@ export default {
// if (top < 0) top = 0
// else if (top > hMax) top = hMax
- el.style.left = `${left}px`
- el.style.top = `${top}px`
- }
+ el.style.left = `${left}px`;
+ el.style.top = `${top}px`;
+ };
- document.onmouseup = () => {
- el.classList.remove('v-drag-active')
- document.onmousemove = document.onmouseup = null
- }
- }
+ document.onmouseup = (): void => {
+ el.classList.remove('v-drag-active');
+ document.onmousemove = null;
+ document.onmouseup = null;
+ };
+ };
}
},
- unmounted(el) {
- el.onmousedown = null
- el.ontouchstart = null
+ unmounted(el: DragElement): void {
+ el.onmousedown = null;
+ el.ontouchstart = null;
}
-}
+};
+
+export default dragDirective;
\ No newline at end of file
diff --git a/src/packages/components/Tasks/Tasks/index.ts b/src/packages/components/Tasks/Tasks/index.ts
index 7981910..de738b9 100644
--- a/src/packages/components/Tasks/Tasks/index.ts
+++ b/src/packages/components/Tasks/Tasks/index.ts
@@ -17,6 +17,10 @@ import { TaskAddRouteConfig } from './TaskAddRoute/index';
import { TaskRoutePlanConfig } from './TaskRoutePlan/index';
import {TaskAssignConfig} from './TaskAssign';
import {HikvisionConfig} from './Hikvision';
+import {OnlineUsersConfig} from './OnlineUsers';
+import { LocationSearchConfig } from './LocationSearch';
+import { MeasureToolsConfig } from './MeasureTools';
+
export default [
@@ -39,4 +43,6 @@ export default [
TaskRoutePlanConfig,
TaskAssignConfig,
HikvisionConfig,
+ OnlineUsersConfig,
+ MeasureToolsConfig,
];
diff --git a/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/config.ts b/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/config.ts
index 06bc419..6ab4b73 100644
--- a/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/config.ts
+++ b/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/config.ts
@@ -6,17 +6,12 @@ import { ZhiChu_LuXianGuHuaConfig } from './index'
export const option = {
dataset: {
- startName: '救援队伍1',
- startLngLat: [117.923964,35.405512],
- way: [
- {
- wayName: '国庄村',
- wayLngLat: [117.915252,35.365226],
- wayFlag: true,
- },
- ],
- endName: '费县北站',
- endLngLat: [117.931713,35.319092],
+ startName: '起点',
+ startLngLat: [],
+ way: [],
+ endName: '终点',
+ endLngLat: [],
+ endWay:[]
},
dataStyle:{
marginTop: 25,
diff --git a/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/index.vue b/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/index.vue
index 466b539..42bd315 100644
--- a/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/index.vue
+++ b/src/packages/components/Zhichu/Zhichu/ZhiChu_LuXianGuHua/index.vue
@@ -8,12 +8,14 @@
路径规划
+
+
+
@@ -57,18 +61,7 @@
/>
-
+ {{ item.wayName }}
+
+
- {{ option.dataset.endName }}
+
+ 终点
+
+
+
+
+
+
+
+
+ {{ index + 1 }}
+
+
+
+
+
+ {{ item.wayName }}
+
+
+
+
+
+
+
@@ -171,6 +226,10 @@
import { useChartDataFetch } from '@/hooks';
import cloneDeep from 'lodash/cloneDeep';
import { PlusOutlined, CloseCircleOutlined, MinusCircleOutlined } from '@ant-design/icons-vue';
+ import {wgs84ToGcj02} from './lib/CoordinateTransform';
+ import { getNameByPosition } from './lib/AMapApi';
+ import { getRouter } from './lib/Navigation';
+ import { getRouterFunc, drawRouterFunc, clearRouterFunc,handlerStartRoaming,handlerStopRoaming } from './lib/routePath'
import {
CloseButton,
Title,
@@ -194,6 +253,7 @@
import { useMessage } from '@/hooks/web/useMessage';
import { gcj02towgs84, wgs84togcj02 } from 'coordtransform';
import * as mars3d from 'mars3d';
+ import * as Cesium from 'mars3d-cesium';
const { createMessage } = useMessage();
@@ -247,18 +307,90 @@
};
// 途经点-增加
- function addWayPoint() {
+ async function addWayPoint() {
+
if (option.dataset.way.length > 15) {
createMessage.warning('途经地点最多只能设置16个');
return;
}
- option.dataset.way.push({
- wayName: '',
- wayLngLat: [],
- wayFlag: false,
- });
+
+ // 获取坐标 调用高德查询坐标处名称
+ let way = await setMarkPoint("start");
+
+
+
// selectWayPointOptions.value.push({});
}
+
+ async function setMarkPoint(type){
+
+ // 设置鼠标+
+ window.globalMap.setCursor("crosshair");
+
+ window.globalMap.once(mars3d.EventType.click, async function (event) {
+ // 设置鼠标默认
+ window.globalMap.setCursor("default")
+ const cartesian = event.cartesian
+ const point = mars3d.LngLatPoint.fromCartesian(cartesian)
+ point.format()
+
+ let response = await getNameByPosition(point);
+
+ if (response.data.status === "1" || response.data.infocode === "10000") {
+
+ option.dataset.way.push({
+ wayName: response.data.regeocode.formatted_address,
+ wayLngLat: [point.lng,point.lat],
+ wayFlag: false,
+ })
+ } else {
+ option.dataset.way.push({
+ wayName: point.lng+","+point.lat,
+ wayLngLat: [point.lng,point.lat],
+ wayFlag: false,
+ });
+ }
+
+ drawPoint("start",point.lng,point.lat,point.alt);
+
+ })
+ }
+
+
+ async function setEndMarkPoint(type){
+
+ // 设置鼠标+
+ window.globalMap.setCursor("crosshair");
+
+ window.globalMap.once(mars3d.EventType.click, async function (event) {
+ // 设置鼠标默认
+ window.globalMap.setCursor("default")
+ const cartesian = event.cartesian
+ const point = mars3d.LngLatPoint.fromCartesian(cartesian)
+ point.format()
+
+ let response = await getNameByPosition(point);
+
+ if (response.data.status === "1" || response.data.infocode === "10000") {
+
+ option.dataset.endWay = [{
+ wayName: response.data.regeocode.formatted_address,
+ wayLngLat: [point.lng,point.lat],
+ wayFlag: false,
+ }]
+ } else {
+ option.dataset.endWay = [{
+ wayName: point.lng+","+point.lat,
+ wayLngLat: [point.lng,point.lat],
+ wayFlag: false,
+ }];
+ }
+
+ drawPoint("end",point.lng,point.lat,point.alt);
+ })
+ }
+
+
// 途经点-修改状态
function changeWayPointFlag(item) {
item.wayFlag = !item.wayFlag;
@@ -292,6 +424,69 @@
option.dataset.way.splice(index, 1);
}
}
+
+ // 设置终点
+ function setEndPoint() {
+ setEndMarkPoint();
+ }
+
+
+ let pathPointGraphicLayer = null;
+ let startGraphicEntity= [];
+ let endGraphicEntity = null;
+
+ function clearDraw(){
+
+ clearRouterFunc();
+
+ pathPointGraphicLayer ? pathPointGraphicLayer.clear() : null;
+ }
+
+ function drawPoint(type, lng, lat, z) { // 绘制起点、终点
+
+ if(pathPointGraphicLayer == null){
+ pathPointGraphicLayer = new mars3d.layer.GraphicLayer();
+ window.globalMap.addLayer(pathPointGraphicLayer);
+ }
+
+ let image = null;
+ if(type == 'start'){
+ image = "/components/Map/navigation-start-point.png"
+ var graphic = new mars3d.graphic.BillboardEntity({
+ position: [lng, lat, z],
+ style: {
+ image: image,
+ horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
+ verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
+ clampToGround: true
+ },
+ attr: { remark: type == 'start'?'起点':'终点' }
+ })
+ startGraphicEntity.push(graphic);
+ pathPointGraphicLayer.addGraphic(graphic);
+
+ }else if(type == 'end'){
+ image = "/components/Map/navigation-end-point.png"
+
+ if(endGraphicEntity){
+ pathPointGraphicLayer.removeGraphic(endGraphicEntity);
+ endGraphicEntity = null;
+ }
+
+ endGraphicEntity = new mars3d.graphic.BillboardEntity({
+ position: [lng, lat, z],
+ style: {
+ image: image,
+ horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
+ verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
+ clampToGround: true
+ },
+ attr: { remark: type == 'start'?'起点':'终点' }
+ })
+ pathPointGraphicLayer.addGraphic(endGraphicEntity);
+ }
+ }
+
// 移动位置
function moveLocation(lngLat) {
if (lngLat.length > 0) {
@@ -429,6 +624,11 @@
}
}
+ function hnadlerGetPoint () {
+ window.globalMap.on(mars3d.EventType.click,(e)=>{
+ console.log(e);
+ })
+ }
// 驾车还是步行--------------------------------------------------------------------------
const driveOrWalk = ref('drive');
const nowLine = ref(0);
@@ -438,7 +638,7 @@
() => driveOrWalk.value,
() => {
// 获取高德路线
- directionRoute();
+ // directionRoute();
},
);
@@ -447,53 +647,88 @@
// 获取高德路线
const directionRoute = () => {
+
+ let endPoint = option.dataset.endWay[0]
+
+ option.dataset.way?.forEach((item,index)=>{
+
+ let postgisParams = {
+ startlng: item.wayLngLat[0],
+ startlat: item.wayLngLat[1],
+ endlng: endPoint.wayLngLat[0],
+ endlat: endPoint.wayLngLat[1],
+ areaname: "feixian",
+ }
+
+ // getRouter(postgisParams);
+
+ getRouterFunc(postgisParams,'all').then(res => {
+ if(res){
+ // this.tripFlyArray[index] = res.allCoordinates;
+ console.log("res:999",res);
+ drawRouterFunc(res)
+ }else{
+ // this.$message({
+ // type:"error",
+ // message:"PostGIS未找到合适了路线"
+ // })
+ }
+ }).catch(err => {
+ clearRouterFunc()
+ })
+
+
+
+ })
+
+
// 步行
- if (driveOrWalk.value == 'walk') {
- getWalkingRoute({
- startlng: option.dataset.startLngLat[0],
- startlat: option.dataset.startLngLat[1],
- endlng: option.dataset.endLngLat[0],
- endlat: option.dataset.endLngLat[1],
- }).then((result) => {
- if (typeof result == 'string') {
- if (result == 'OVER_DIRECTION_RANGE') {
- createMessage.warning('距离太远,超过导航范围!');
- return;
- }
- if (result == 'USER DAILY_QUERY_OVER_LIMIT') {
- createMessage.warning('已经达到用户每日查询限制!');
- return;
- }
- }
- lineResult.value = result;
- // 路线叠加到地图上,默认第一条为当前道路
- getLocationLines(null);
- });
- }
- // 驾车
- if (driveOrWalk.value == 'drive') {
- getDrivingRoute({
- startlng: option.dataset.startLngLat[0],
- startlat: option.dataset.startLngLat[1],
- endlng: option.dataset.endLngLat[0],
- endlat: option.dataset.endLngLat[1],
- way: option.dataset.way,
- }).then((result) => {
- if (typeof result == 'string') {
- if (result == 'OVER_DIRECTION_RANGE') {
- createMessage.warning('距离太远,超过导航范围!');
- return;
- }
- if (result == 'USER DAILY_QUERY_OVER_LIMIT') {
- createMessage.warning('已经达到用户每日查询限制!');
- return;
- }
- }
- lineResult.value = result;
- // 路线叠加到地图上
- getLocationLines(null);
- });
- }
+ // if (driveOrWalk.value == 'walk') {
+ // getWalkingRoute({
+ // startlng: option.dataset.startLngLat[0],
+ // startlat: option.dataset.startLngLat[1],
+ // endlng: option.dataset.endLngLat[0],
+ // endlat: option.dataset.endLngLat[1],
+ // }).then((result) => {
+ // if (typeof result == 'string') {
+ // if (result == 'OVER_DIRECTION_RANGE') {
+ // createMessage.warning('距离太远,超过导航范围!');
+ // return;
+ // }
+ // if (result == 'USER DAILY_QUERY_OVER_LIMIT') {
+ // createMessage.warning('已经达到用户每日查询限制!');
+ // return;
+ // }
+ // }
+ // lineResult.value = result;
+ // // 路线叠加到地图上,默认第一条为当前道路
+ // getLocationLines(null);
+ // });
+ // }
+ // // 驾车
+ // if (driveOrWalk.value == 'drive') {
+ // getDrivingRoute({
+ // startlng: option.dataset.startLngLat[0],
+ // startlat: option.dataset.startLngLat[1],
+ // endlng: option.dataset.endLngLat[0],
+ // endlat: option.dataset.endLngLat[1],
+ // way: option.dataset.way,
+ // }).then((result) => {
+ // if (typeof result == 'string') {
+ // if (result == 'OVER_DIRECTION_RANGE') {
+ // createMessage.warning('距离太远,超过导航范围!');
+ // return;
+ // }
+ // if (result == 'USER DAILY_QUERY_OVER_LIMIT') {
+ // createMessage.warning('已经达到用户每日查询限制!');
+ // return;
+ // }
+ // }
+ // lineResult.value = result;
+ // // 路线叠加到地图上
+ // getLocationLines(null);
+ // });
+ // }
};
// 路线叠加到地图上
@@ -564,13 +799,13 @@
onMounted(() => {
setTimeout(() => {
// 右键添加功能(起点、终点、途径点)
- setContextmenuByRightClick();
+ // setContextmenuByRightClick();
// 地图-起点、终点、途经点
- getLocationPoints('start');
- getLocationPoints('end');
- getLocationPoints('way');
+ // getLocationPoints('start');
+ // getLocationPoints('end');
+ // getLocationPoints('way');
// 获取高德路线+路线叠加到地图上
- directionRoute();
+ // directionRoute();
}, 1000);
});
@@ -799,6 +1034,10 @@
option.dataStyle.driveOrWalkHeight = (option.dataStyle.driveOrWalkWidth / 81) * 23;
},
);
+
+
+
+