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

更改ip地址

parent e5f9c274
......@@ -290,8 +290,8 @@
></div>
</body>
<!-- <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="http://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="./SignalLines.js"></script>
<!-- <script src="./data.js"></script> -->
</head>
......@@ -322,6 +322,8 @@
var trafficEventSocket = null;
var trafficEventArr = []; // 记录所有的交通事件
var ipAdd = "192.168.60.137"; //192.168.60.137 \\ 172.29.128.78
//高亮模型Id
var highlightModelId = null;
var handler = (e) => {
......@@ -331,8 +333,8 @@
initMap("51world");
async function initMap(gis_sdk) {
// var url = "http://192.168.60.110: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 = "https://localhost:3000/hdmap-platform/gateway/cmap2";
var url = "http://localhost:3000/hdmap-platform/gateway/cmap2";
var secretKey = "10b79c61bf1b42e2";
var config = {
......@@ -367,8 +369,8 @@
var options = {
// longitude: 117.346635,
// latitude: 38.99408,
longitude:117.346852,
latitude:38.998567,
longitude: 117.346719,
latitude: 38.998858,
height: 39.30901,
};
map.setZoomAndCenter(options);
......@@ -611,15 +613,15 @@
var data = [
{
equipmentCode: "S-LC-2503", //编号
longitude: 117.318166,
latitude: 38.98827,
longitude: 117.346719,
latitude: 38.998858,
height: 5,
radius: 20, //辐射圈的大小,这个字段目前是晶众使用有效
},
{
equipmentCode: "S-LC-2504", //编号
longitude: 117.319236,
latitude: 38.98829,
longitude: 117.346911,
latitude: 38.998638,
height: 5,
radius: 20, //辐射圈的大小,这个字段目前是晶众使用有效
},
......@@ -827,7 +829,7 @@
async function addTrafficFlow() {
const json = {
id: "21e7a9e6d2884122804788dac1e002cc",
url: "ws://172.29.128.78:31000/ws/streamer/a9219e09346a44a28ee3d0aed79c27ea", // 全部车辆
url: `ws://${ipAdd}:31000/ws/streamer/a9219e09346a44a28ee3d0aed79c27ea`, // 全部车辆
};
map.bindVehicle(json);
}
......@@ -836,7 +838,7 @@
async function addTrafficFlow6() {
const json = {
id: "21e7a9e6d2884122804788dac1e002cc",
url: "ws://172.29.128.78:31000/ws/streamer/e7c584dd5d294347bbc3ccec2f0aa8ea", // 6号车
url: `ws://${ipAdd}:31000/ws/streamer/e7c584dd5d294347bbc3ccec2f0aa8ea`, // 6号车
};
map.bindVehicle(json);
}
......@@ -931,8 +933,7 @@
}
const json = {
id: "111", //ID
url: "ws://172.29.128.78:31000/ws/streamer/86bf3faefe5f423483e4cd4d9782b046", // 全路口
// url: 'ws://172.29.128.78:31000/ws/streamer/eccd0f8b060d4bb088a1b9af1ad4070f', // 6号路口
url: `ws://${ipAdd}:31000/ws/streamer/86bf3faefe5f423483e4cd4d9782b046`, // 全路口
};
perceptualroad.bindObjects(json);
perceptual = true; //是否加载了感知物
......@@ -967,7 +968,7 @@
height: "10", //高度
opacity: "0.75", //透明度
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: [
{ minSpeed: 0, maxSpeed: 30, color: "#FF0000" },
{ minSpeed: 30, maxSpeed: 60, color: "#FFFF00" },
......@@ -1074,7 +1075,7 @@
}
// 测试某一个类型
if ( type == "ROADWORK") {
if (type == "ROADWORK") {
fly++;
if (fly == 3) {
const optionsTest1 = {
......@@ -1241,7 +1242,7 @@
camera.flyTo(options);
const json = {
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);
}
......@@ -1305,7 +1306,7 @@
// 当接收到消息时执行
v2xSocket.onmessage = function (event) {
let data = JSON.parse(event.data);
let { objects, endTime, typeName, id,type } = data;
let { objects, endTime, typeName, id, type } = data;
// objects 如果只有一项,则是单车预警;如果有两项,则需要有两个车辆的通信效果
let mainCar = objects[0];
......@@ -1322,10 +1323,9 @@
color: [255, 0, 0, 1],
vehicleId: mainCar.id,
name: typeName,
AlarmDirect:type,
AlarmDirect: type,
};
map.getVehicle("21e7a9e6d2884122804788dac1e002cc").startV2x(options);
map.bindV2X(options);
if (objects.length > 1) {
const options2 = {
id,
......@@ -1342,9 +1342,7 @@
}
if (endTime) {
map
.getVehicle("21e7a9e6d2884122804788dac1e002cc")
.stopV2x(mainCar.id);
map.removeV2Xs(mainCar.id);
v2xArr.splice(
v2xArr.findIndex((item) => item.id === id),
1
......@@ -1359,9 +1357,7 @@
vehicleId: lastV2x.objects[0].id,
name: lastV2x.name,
};
map
.getVehicle("21e7a9e6d2884122804788dac1e002cc")
.startV2x(options);
map.bindV2X(options);
}
const options2 = {
......@@ -1386,13 +1382,11 @@
v2xSocket.close();
v2xArr.forEach((item) => {
map
.getVehicle("21e7a9e6d2884122804788dac1e002cc")
.stopV2x(item.objects[0].id);
map.removeV2Xs(item.objects[0].id);
if (item.objects.length > 1) {
const options2 = {
id,
id:item.id,
vehicleId: [item.objects[0].id, item.objects[1].id], //车辆ID
};
map.stopCommunication(options2);
......@@ -1405,7 +1399,7 @@
document.getElementById("startV2XGan").onclick = startV2XGan;
function startV2XGan() {
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);
}
......
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