0623
This commit is contained in:
parent
0f1740f301
commit
ae2a7370ed
|
@ -4,20 +4,20 @@
|
||||||
var bmapcfg = {
|
var bmapcfg = {
|
||||||
'imgext': '.jpg', //瓦片图的后缀 ------ 根据需要修改,一般是 .png .jpg
|
'imgext': '.jpg', //瓦片图的后缀 ------ 根据需要修改,一般是 .png .jpg
|
||||||
//这里我直接用的路径是/static/bmap_offline_demo/tiles,如果瓦片数量较大,可改为瓦片服务的地址
|
//这里我直接用的路径是/static/bmap_offline_demo/tiles,如果瓦片数量较大,可改为瓦片服务的地址
|
||||||
// tiles_dir: "images", //普通瓦片图的地址,为空默认在 offlinemap/tiles/ 目
|
tiles_dir: "images", //普通瓦片图的地址,为空默认在 offlinemap/tiles/ 目
|
||||||
//现场
|
//现场
|
||||||
tiles_dir: "map", //普通瓦片图的地址,为空默认在 offlinemap/tiles/ 目
|
// tiles_dir: "map", //普通瓦片图的地址,为空默认在 offlinemap/tiles/ 目
|
||||||
// tiles_path : 'http://172.16.1.162:8123/HeBeiDarkMap/',
|
tiles_path : 'http://172.16.1.162:8123/HeBeiDarkMap/',
|
||||||
// tiles_hybrid: 'http://172.16.1.162:8123/HeBeiDarkMap/', //卫星瓦片图的地址,为空默认在 offlinemap/tiles_hybrid/ 目
|
tiles_hybrid: 'http://172.16.1.162:8123/HeBeiDarkMap/', //卫星瓦片图的地址,为空默认在 offlinemap/tiles_hybrid/ 目
|
||||||
// tiles_self : 'http://172.16.1.162:8123/HeBeiDarkMap/' //自定义图层的地址,为空默认在 offlinemap/tiles_self/ 目录
|
tiles_self : 'http://172.16.1.162:8123/HeBeiDarkMap/' //自定义图层的地址,为空默认在 offlinemap/tiles_self/ 目录
|
||||||
// tiles_path: "http://111.229.30.246:4008/HeBeiDarkMap/",
|
// tiles_path: "http://111.229.30.246:4008/HeBeiDarkMap/",
|
||||||
// tiles_hybrid: "http://111.229.30.246:4008/HeBeiDarkMap/", //卫星瓦片图的地址,为空默认在 offlinemap/tiles_hybrid/ 目
|
// tiles_hybrid: "http://111.229.30.246:4008/HeBeiDarkMap/", //卫星瓦片图的地址,为空默认在 offlinemap/tiles_hybrid/ 目
|
||||||
// tiles_self: "http://111.229.30.246:4008/HeBeiDarkMap/", //自定义图层的地址,为空默认在 offlinemap/tiles_self/ 目录
|
// tiles_self: "http://111.229.30.246:4008/HeBeiDarkMap/", //自定义图层的地址,为空默认在 offlinemap/tiles_self/ 目录
|
||||||
|
|
||||||
//现场
|
//现场
|
||||||
tiles_path: "http://13.14.64.150:3638/",
|
// tiles_path: "http://13.14.64.150:3638/",
|
||||||
tiles_hybrid: "http://13.14.64.150:3638/", //卫星瓦片图的地址,为空默认在 offlinemap/tiles_hybrid/ 目
|
// tiles_hybrid: "http://13.14.64.150:3638/", //卫星瓦片图的地址,为空默认在 offlinemap/tiles_hybrid/ 目
|
||||||
tiles_self: "http://13.14.64.150:3638/", //自定义图层的地址,为空默认在 offlinemap/tiles_self/ 目录
|
// tiles_self: "http://13.14.64.150:3638/", //自定义图层的地址,为空默认在 offlinemap/tiles_self/ 目录
|
||||||
};
|
};
|
||||||
|
|
||||||
//下面的保持不动///
|
//下面的保持不动///
|
||||||
|
|
|
@ -106,3 +106,7 @@ export const getVideoDeviceList = (param: any = {}) => {
|
||||||
export const videoStream=(param:any={})=>{
|
export const videoStream=(param:any={})=>{
|
||||||
return GET('/video/stream',param)
|
return GET('/video/stream',param)
|
||||||
}
|
}
|
||||||
|
//获取拥堵路段
|
||||||
|
export const getListCurrentMonth = (param: any = {}) => {
|
||||||
|
return GET('/device/mevent/listCurrentMonth', param);
|
||||||
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, nextTick } from "vue";
|
import { ref, nextTick } from "vue";
|
||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
import { getDeviceList } from "@/api/modules/index";
|
import { getDeviceList,getListCurrentMonth } from "@/api/modules/index";
|
||||||
import { emitter } from "@/utils/eventBus";
|
import { emitter } from "@/utils/eventBus";
|
||||||
const emit = defineEmits(["show-device-info"]);
|
const emit = defineEmits(["show-device-info"]);
|
||||||
const markerMap = ref({
|
const markerMap = ref({
|
||||||
|
@ -125,6 +125,8 @@ onMounted(async () => {
|
||||||
map.addEventListener("click", (e) => {
|
map.addEventListener("click", (e) => {
|
||||||
console.log("点击的坐标:", e.point.lng, e.point.lat);
|
console.log("点击的坐标:", e.point.lng, e.point.lat);
|
||||||
});
|
});
|
||||||
|
const rest = await getListCurrentMonth();
|
||||||
|
console.log("rest",rest)
|
||||||
// 定义路径点数组
|
// 定义路径点数组
|
||||||
var points1 = [
|
var points1 = [
|
||||||
new BMap.Point(115.816121923,37.726502586),
|
new BMap.Point(115.816121923,37.726502586),
|
||||||
|
@ -672,29 +674,23 @@ new BMap.Point(117.625417017,38.185147089),
|
||||||
map.addOverlay(polyline);
|
map.addOverlay(polyline);
|
||||||
|
|
||||||
var points = [
|
var points = [
|
||||||
new BMap.Point(116.727201337,37.868629410),
|
new BMap.Point(116.476017151,37.820685846),
|
||||||
new BMap.Point(116.730039983,37.868942756),
|
new BMap.Point(116.478927660,37.820571827),
|
||||||
new BMap.Point(116.732591170,37.869227615),
|
new BMap.Point(116.481622577,37.820486313),
|
||||||
new BMap.Point(116.735034561,37.869512473),
|
new BMap.Point(116.483059866,37.820486313),
|
||||||
new BMap.Point(116.737495918,37.869825816),
|
new BMap.Point(116.487946648,37.820486313),
|
||||||
new BMap.Point(116.740226767,37.870224613),
|
new BMap.Point(116.491791395,37.820600332),
|
||||||
new BMap.Point(116.742382700,37.870580681),
|
new BMap.Point(116.496175126,37.821027903),
|
||||||
new BMap.Point(116.744035582,37.870908261),
|
|
||||||
new BMap.Point(116.746622702,37.871435235),
|
|
||||||
new BMap.Point(116.748778636,37.872019176),
|
|
||||||
new BMap.Point(116.750970501,37.872631596),
|
|
||||||
new BMap.Point(116.753036604,37.873244010),
|
|
||||||
new BMap.Point(116.754976944,37.873970356),
|
|
||||||
new BMap.Point(116.755551859,37.874141260),
|
|
||||||
];
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
const congestionValues = [0.3, 0.8];
|
const congestionValues = [0.3, 0.8];
|
||||||
for (let i = 0; i < points.length - 1; i++) {
|
for (let i = 0; i < points.length - 1; i++) {
|
||||||
const congestion = congestionValues[i] || 0; // 默认不拥堵
|
const congestion = congestionValues[i] || 0; // 默认不拥堵
|
||||||
|
|
||||||
// 根据拥堵程度计算红色深浅 (0-255)
|
// 根据拥堵程度计算红色深浅 (0-255)
|
||||||
const red = Math.floor(100 + 155 * congestion); // 浅红(100,0,0)到深红(255,0,0)
|
const red = Math.floor(100 + 155 * congestion); // 浅红(100,0,0)到深红(255,0,0)
|
||||||
const color = `rgb(${red}, 0, 0)`;
|
const color = `rgb(255, 0, 0)`;
|
||||||
|
|
||||||
// 创建单段线段
|
// 创建单段线段
|
||||||
const segment = new BMap.Polyline([points[i], points[i + 1]], {
|
const segment = new BMap.Polyline([points[i], points[i + 1]], {
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
|
||||||
rewrite: (path) => path.replace(new RegExp(`^${viteEnv.VITE_APP_CONTROL_BASE_API}`), ''),
|
rewrite: (path) => path.replace(new RegExp(`^${viteEnv.VITE_APP_CONTROL_BASE_API}`), ''),
|
||||||
},
|
},
|
||||||
[viteEnv.VITE_APP_BASE_API]: {
|
[viteEnv.VITE_APP_BASE_API]: {
|
||||||
target: 'http://172.16.1.133:8081/iotApi',
|
target: 'http://172.16.1.128:8090/iotApi',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(new RegExp(`^${viteEnv.VITE_APP_BASE_API}`), ''),
|
rewrite: (path) => path.replace(new RegExp(`^${viteEnv.VITE_APP_BASE_API}`), ''),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue