Commit 80558aae authored by 吕 成东's avatar 吕 成东
Browse files

更改ip地址

parent e5f9c274
...@@ -290,8 +290,8 @@ ...@@ -290,8 +290,8 @@
></div> ></div>
</body> </body>
<!-- <script src="http://192.168.60.110:3000/gis_sdk/js/CMapLoader.map.js"></script> --> <!-- <script src="http://192.168.60.110:3000/gis_sdk/js/CMapLoader.map.js"></script> -->
<script src="https://localhost:3000/gis_sdk/js/CMapLoader.map.js"></script> <!-- <script src="https://localhost:3000/gis_sdk/js/CMapLoader.map.js"></script> -->
<!-- <script src="http://localhost:3000/gis_sdk/js/CMapLoader.map.js"></script> --> <script src="http://localhost:3000/gis_sdk/js/CMapLoader.map.js"></script>
<script src="./SignalLines.js"></script> <script src="./SignalLines.js"></script>
<!-- <script src="./data.js"></script> --> <!-- <script src="./data.js"></script> -->
</head> </head>
...@@ -322,6 +322,8 @@ ...@@ -322,6 +322,8 @@
var trafficEventSocket = null; var trafficEventSocket = null;
var trafficEventArr = []; // 记录所有的交通事件 var trafficEventArr = []; // 记录所有的交通事件
var ipAdd = "192.168.60.137"; //192.168.60.137 \\ 172.29.128.78
//高亮模型Id //高亮模型Id
var highlightModelId = null; var highlightModelId = null;
var handler = (e) => { var handler = (e) => {
...@@ -331,8 +333,8 @@ ...@@ -331,8 +333,8 @@
initMap("51world"); initMap("51world");
async function initMap(gis_sdk) { async function initMap(gis_sdk) {
// var url = "http://192.168.60.110:3000/hdmap-platform/gateway/cmap2"; // var url = "http://192.168.60.110:3000/hdmap-platform/gateway/cmap2";
var url = "https://localhost:3000/hdmap-platform/gateway/cmap2"; // var url = "https://localhost:3000/hdmap-platform/gateway/cmap2";
// var url = "http://localhost:3000/hdmap-platform/gateway/cmap2"; var url = "http://localhost:3000/hdmap-platform/gateway/cmap2";
var secretKey = "10b79c61bf1b42e2"; var secretKey = "10b79c61bf1b42e2";
var config = { var config = {
...@@ -367,8 +369,8 @@ ...@@ -367,8 +369,8 @@
var options = { var options = {
// longitude: 117.346635, // longitude: 117.346635,
// latitude: 38.99408, // latitude: 38.99408,
longitude:117.346852, longitude: 117.346719,
latitude:38.998567, latitude: 38.998858,
height: 39.30901, height: 39.30901,
}; };
map.setZoomAndCenter(options); map.setZoomAndCenter(options);
...@@ -611,15 +613,15 @@ ...@@ -611,15 +613,15 @@
var data = [ var data = [
{ {
equipmentCode: "S-LC-2503", //编号 equipmentCode: "S-LC-2503", //编号
longitude: 117.318166, longitude: 117.346719,
latitude: 38.98827, latitude: 38.998858,
height: 5, height: 5,
radius: 20, //辐射圈的大小,这个字段目前是晶众使用有效 radius: 20, //辐射圈的大小,这个字段目前是晶众使用有效
}, },
{ {
equipmentCode: "S-LC-2504", //编号 equipmentCode: "S-LC-2504", //编号
longitude: 117.319236, longitude: 117.346911,
latitude: 38.98829, latitude: 38.998638,
height: 5, height: 5,
radius: 20, //辐射圈的大小,这个字段目前是晶众使用有效 radius: 20, //辐射圈的大小,这个字段目前是晶众使用有效
}, },
...@@ -827,7 +829,7 @@ ...@@ -827,7 +829,7 @@
async function addTrafficFlow() { async function addTrafficFlow() {
const json = { const json = {
id: "21e7a9e6d2884122804788dac1e002cc", id: "21e7a9e6d2884122804788dac1e002cc",
url: "ws://172.29.128.78:31000/ws/streamer/a9219e09346a44a28ee3d0aed79c27ea", // 全部车辆 url: `ws://${ipAdd}:31000/ws/streamer/a9219e09346a44a28ee3d0aed79c27ea`, // 全部车辆
}; };
map.bindVehicle(json); map.bindVehicle(json);
} }
...@@ -836,7 +838,7 @@ ...@@ -836,7 +838,7 @@
async function addTrafficFlow6() { async function addTrafficFlow6() {
const json = { const json = {
id: "21e7a9e6d2884122804788dac1e002cc", id: "21e7a9e6d2884122804788dac1e002cc",
url: "ws://172.29.128.78:31000/ws/streamer/e7c584dd5d294347bbc3ccec2f0aa8ea", // 6号车 url: `ws://${ipAdd}:31000/ws/streamer/e7c584dd5d294347bbc3ccec2f0aa8ea`, // 6号车
}; };
map.bindVehicle(json); map.bindVehicle(json);
} }
...@@ -931,8 +933,7 @@ ...@@ -931,8 +933,7 @@
} }
const json = { const json = {
id: "111", //ID id: "111", //ID
url: "ws://172.29.128.78:31000/ws/streamer/86bf3faefe5f423483e4cd4d9782b046", // 全路口 url: `ws://${ipAdd}:31000/ws/streamer/86bf3faefe5f423483e4cd4d9782b046`, // 全路口
// url: 'ws://172.29.128.78:31000/ws/streamer/eccd0f8b060d4bb088a1b9af1ad4070f', // 6号路口
}; };
perceptualroad.bindObjects(json); perceptualroad.bindObjects(json);
perceptual = true; //是否加载了感知物 perceptual = true; //是否加载了感知物
...@@ -967,7 +968,7 @@ ...@@ -967,7 +968,7 @@
height: "10", //高度 height: "10", //高度
opacity: "0.75", //透明度 opacity: "0.75", //透明度
dataUrl: "D://51world//rlt//hdmap1.4(GCJ02_Ortho)_v2.xodr", //文件地址 dataUrl: "D://51world//rlt//hdmap1.4(GCJ02_Ortho)_v2.xodr", //文件地址
url: "ws://172.29.128.78:33021/AnalyzeResult", //ws地址 url: `ws://${ipAdd}:33021/AnalyzeResult`, //ws地址
colorSymbols: [ colorSymbols: [
{ minSpeed: 0, maxSpeed: 30, color: "#FF0000" }, { minSpeed: 0, maxSpeed: 30, color: "#FF0000" },
{ minSpeed: 30, maxSpeed: 60, color: "#FFFF00" }, { minSpeed: 30, maxSpeed: 60, color: "#FFFF00" },
...@@ -1074,7 +1075,7 @@ ...@@ -1074,7 +1075,7 @@
} }
// 测试某一个类型 // 测试某一个类型
if ( type == "ROADWORK") { if (type == "ROADWORK") {
fly++; fly++;
if (fly == 3) { if (fly == 3) {
const optionsTest1 = { const optionsTest1 = {
...@@ -1241,7 +1242,7 @@ ...@@ -1241,7 +1242,7 @@
camera.flyTo(options); camera.flyTo(options);
const json = { const json = {
id: "21002cc", id: "21002cc",
url: "ws://172.29.128.78:31000/ws/streamer/489d02b4-80de-42e6-b0fc-95c4bd006760", url: `ws://${ipAdd}:31000/ws/streamer/489d02b4-80de-42e6-b0fc-95c4bd006760`,
}; };
map.bindHistoryVehicle(json); map.bindHistoryVehicle(json);
} }
...@@ -1305,11 +1306,11 @@ ...@@ -1305,11 +1306,11 @@
// 当接收到消息时执行 // 当接收到消息时执行
v2xSocket.onmessage = function (event) { v2xSocket.onmessage = function (event) {
let data = JSON.parse(event.data); let data = JSON.parse(event.data);
let { objects, endTime, typeName, id,type } = data; let { objects, endTime, typeName, id, type } = data;
// objects 如果只有一项,则是单车预警;如果有两项,则需要有两个车辆的通信效果 // objects 如果只有一项,则是单车预警;如果有两项,则需要有两个车辆的通信效果
let mainCar = objects[0]; let mainCar = objects[0];
let otherCar = objects[1]; let otherCar = objects[1];
// 如果id不在v2xArr中,则添加 // 如果id不在v2xArr中,则添加
const find = v2xArr.find((item) => item.id === id); const find = v2xArr.find((item) => item.id === id);
...@@ -1322,10 +1323,9 @@ ...@@ -1322,10 +1323,9 @@
color: [255, 0, 0, 1], color: [255, 0, 0, 1],
vehicleId: mainCar.id, vehicleId: mainCar.id,
name: typeName, name: typeName,
AlarmDirect:type, AlarmDirect: type,
}; };
map.getVehicle("21e7a9e6d2884122804788dac1e002cc").startV2x(options); map.bindV2X(options);
if (objects.length > 1) { if (objects.length > 1) {
const options2 = { const options2 = {
id, id,
...@@ -1342,9 +1342,7 @@ ...@@ -1342,9 +1342,7 @@
} }
if (endTime) { if (endTime) {
map map.removeV2Xs(mainCar.id);
.getVehicle("21e7a9e6d2884122804788dac1e002cc")
.stopV2x(mainCar.id);
v2xArr.splice( v2xArr.splice(
v2xArr.findIndex((item) => item.id === id), v2xArr.findIndex((item) => item.id === id),
1 1
...@@ -1359,9 +1357,7 @@ ...@@ -1359,9 +1357,7 @@
vehicleId: lastV2x.objects[0].id, vehicleId: lastV2x.objects[0].id,
name: lastV2x.name, name: lastV2x.name,
}; };
map map.bindV2X(options);
.getVehicle("21e7a9e6d2884122804788dac1e002cc")
.startV2x(options);
} }
const options2 = { const options2 = {
...@@ -1386,13 +1382,11 @@ ...@@ -1386,13 +1382,11 @@
v2xSocket.close(); v2xSocket.close();
v2xArr.forEach((item) => { v2xArr.forEach((item) => {
map map.removeV2Xs(item.objects[0].id);
.getVehicle("21e7a9e6d2884122804788dac1e002cc")
.stopV2x(item.objects[0].id);
if (item.objects.length > 1) { if (item.objects.length > 1) {
const options2 = { const options2 = {
id, id:item.id,
vehicleId: [item.objects[0].id, item.objects[1].id], //车辆ID vehicleId: [item.objects[0].id, item.objects[1].id], //车辆ID
}; };
map.stopCommunication(options2); map.stopCommunication(options2);
...@@ -1405,7 +1399,7 @@ ...@@ -1405,7 +1399,7 @@
document.getElementById("startV2XGan").onclick = startV2XGan; document.getElementById("startV2XGan").onclick = startV2XGan;
function startV2XGan() { function startV2XGan() {
const url = const url =
"wss://itg-dev.cu-sc.com:13443/WSPLUS/socket?token=111&msgType=2&reType=51world&vehicleId=269";//& "wss://itg-dev.cu-sc.com:13443/WSPLUS/socket?token=111&msgType=2&reType=51world&vehicleId=269"; //&
startVehicleV2XGan(url); startVehicleV2XGan(url);
} }
...@@ -1424,9 +1418,9 @@ ...@@ -1424,9 +1418,9 @@
// 当接收到消息时执行 // 当接收到消息时执行
v2xGanSocket.onmessage = function (event) { v2xGanSocket.onmessage = function (event) {
let data = JSON.parse(event.data); let data = JSON.parse(event.data);
let { data_list } = data; let { data_list } = data;
let mainCar = data_list[0]; let mainCar = data_list[0];
let poleId = data_list[0].vinfo?.poleId || null; let poleId = data_list[0].vinfo?.poleId || null;
console.log( console.log(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment