智慧工地修改

This commit is contained in:
徐克 2022-08-02 16:29:50 +08:00
parent d347e62b32
commit efc3b24dd4
2 changed files with 65 additions and 60 deletions

View File

@ -1,53 +1,56 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>省公司</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
<script src="TemplateData/UnityProgress.js"></script>
<script src="Build/UnityLoader.js"></script>
<script>
var unityInstance = UnityLoader.instantiate("unityContainer", "Build/sgs.json", {onProgress: UnityProgress});
//开启/关闭楼层面板 arg:true|false
window.parent.FloorUI = function(arg){
console.log("arg11111",arg)
unityInstance.SendMessage("GameManager","FloorUI",arg);
}
//调用停车场
window.parent.FloorBase = function(arg){
console.log("arg",arg)
unityInstance.SendMessage("GameManager","FloorBase",'true');
}
//跳转场景 GongDi MainScene B1 B2 B3 1 2 4 27
window.parent.GotoScene = function (arg){
unityInstance.SendMessage("GameManager","GotoScene",arg);
}
//取消场景
window.parent.cancel = function () {
unityInstance.SendMessage("GameManager","GotoScene","MainScene");
}
//当场景加载完成的时候
function OnSceneLoaded(scene){
window.parent.OnSceneLoaded(scene)
}
//打开全景图
function getUrl(url){
console.log("打开全景",url);
window.parent.postMessage({ status:'200',data:"360全景",panorama:url},'*');
}
</script>
</head>
<body>
<div class="webgl-content" style="width:100%;height: 100%;">
<div id="unityContainer"></div>
<div class="footer">
<div class="webgl-logo"></div>
<div class="fullscreen" onclick="unityInstance.SetFullscreen(1)"></div>
<div class="title">ShengDaPing</div>
</div>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>省公司</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
<script src="TemplateData/UnityProgress.js"></script>
<script src="Build/UnityLoader.js"></script>
<script>
var unityInstance = UnityLoader.instantiate("unityContainer", "Build/sgs.json", { onProgress: UnityProgress });
//开启/关闭楼层面板 arg:true|false
window.parent.FloorUI = function (arg) {
console.log("arg11111", arg)
unityInstance.SendMessage("GameManager", "FloorUI", arg);
}
//调用停车场
window.parent.FloorBase = function (arg) {
console.log("arg", arg)
unityInstance.SendMessage("GameManager", "FloorBase", 'true');
}
//跳转场景 GongDi MainScene B1 B2 B3 1 2 4 27
window.parent.GotoScene = function (arg) {
unityInstance.SendMessage("GameManager", "GotoScene", arg);
}
//取消场景
window.parent.cancel = function () {
unityInstance.SendMessage("GameManager", "GotoScene", "MainScene");
}
//当场景加载完成的时候
function OnSceneLoaded(scene) {
window.parent.OnSceneLoaded(scene)
}
//打开全景图
function getUrl(url) {
console.log("打开全景", url);
window.parent.postMessage({ status: '200', data: "360全景", panorama: url }, '*');
}
</script>
</head>
<body>
<div class="webgl-content" style="width:100%;height: 100%;">
<div id="unityContainer"></div>
<div class="footer">
<div class="webgl-logo"></div>
<div class="fullscreen" onclick="unityInstance.SetFullscreen(1)"></div>
<div class="title">ShengDaPing</div>
</div>
</body>
</html>
</div>
</body>
</html>

View File

@ -36,10 +36,10 @@
var defaultArea = "nj";
var positions = {
// "pk": { name: "浦口区", lng: 118.592631, lat: 32.049500, markers: [{ icon: "images/marker.png", width: 128, height: 128, lng: 118.589631, lat: 32.049500, data: "12345" }, { icon: "images/marker.png", width: 32, height: 32, lng: 118.592832, lat: 32.059502, data: "12345" }] },
// "nj": { "lng": 118.77455, "lat": 32.060982, markers: [{ icon: "images/byyyxq.png",w:300,h:200, lng: 118.77256, lat:32.060982, data: "北阴阳营小区" },{ icon: "images/sads.png",w:300,h:200, lng: 118.77327, lat: 32.05902, data: "苏安大厦" }] },
// "nj": { "lng": 118.77455, "lat": 32.060982, markers: [{ icon: "images/byyyxq.png",lng: 118.77256, lat:32.060982, data: "北阴阳营小区" },{ icon: "images/sads.png", lng: 118.77327, lat: 32.05902, data: "苏安大厦" }] },
"nj": { "lng": 118.77455, "lat": 32.060982, markers: [{ icon: "images/byyyxq.png",lng: 118.77256, lat:32.060982, data: "北阴阳营小区" }] },
// "pk": { name: "浦口区", lng: 118.592631, lat: 32.049500, markers: [{ icon: "images/marker.png", width: 128, height: 128, lng: 118.589631, lat: 32.049500, data: "12345" }, { icon: "images/marker.png", width: 32, height: 32, lng: 118.592832, lat: 32.059502, data: "12345" }] },
// "nj": { "lng": 118.77455, "lat": 32.060982, markers: [{ icon: "images/byyyxq.png",w:300,h:200, lng: 118.77256, lat:32.060982, data: "北阴阳营小区" },{ icon: "images/sads.png",w:300,h:200, lng: 118.77327, lat: 32.05902, data: "苏安大厦" }] },
// "nj": { "lng": 118.77455, "lat": 32.060982, markers: [{ icon: "images/byyyxq.png",lng: 118.77256, lat:32.060982, data: "北阴阳营小区" },{ icon: "images/sads.png", lng: 118.77327, lat: 32.05902, data: "苏安大厦" }] },
"nj": { "lng": 118.77455, "lat": 32.060982, markers: [{ icon: "images/byyyxq.png", lng: 118.77256, lat: 32.060982, data: "北阴阳营小区", wisUrl: "/sgs/index.html" }] },
"jy": { name: "建邺区", lng: 118.729156, lat: 32.005818 },
"gl": { name: "鼓楼区", lng: 118.774862, lat: 32.086006 },
"yh": { name: "雨花区", lng: 118.683091, lat: 31.941923 },
@ -75,8 +75,8 @@
zoom: 16,
// 地图中心点
center: [lng, lat],
//倾斜角度
pitch: 45,
//倾斜角度
pitch: 45,
// 地图默认字体
localIdeographFontFamily: "Microsoft YoHei"
});
@ -126,10 +126,10 @@
el.className = "marker";
// 自定义图标
el.src = markerData.icon;
// el.style.width = markerData.width == undefined ? "64px" : markerData.width + "px";
// el.style.height = markerData.height == undefined ? "64px" : markerData.height + "px";
// el.style.width = markerData.width == undefined ? "260px" : markerData.width + "px";
// el.style.height = markerData.height == undefined ? "150px" : markerData.height + "px";
// el.style.width = markerData.width == undefined ? "64px" : markerData.width + "px";
// el.style.height = markerData.height == undefined ? "64px" : markerData.height + "px";
// el.style.width = markerData.width == undefined ? "260px" : markerData.width + "px";
// el.style.height = markerData.height == undefined ? "150px" : markerData.height + "px";
// 如果不传el会默认给一个蓝色水滴图标
var mk = new SGMap.Marker(el, {
// marker相对经纬度点坐标点的位置
@ -141,7 +141,9 @@
mk.addTo(map);
el.addEventListener("click", function (e) {
/////////////////////////////////自定义输出内容//////////////////////////////////////
console.log("跳转" + e.target.cusData.data);
console.log("跳转" + e.target.cusData.data + 111);
window.parent.postMessage({ data: "建筑工地", params: e.target.cusData.data, url: e.target.cusData.wisUrl }, '*');
// window.GotoScene("GongDi");
});
return mk;