From bd1570a6852a12f18617ab5284867ed897fa891e Mon Sep 17 00:00:00 2001
From: zhaoxing <zhaoxing@shsening.com>
Date: 星期四, 27 七月 2023 13:30:25 +0800
Subject: [PATCH] 增加车辆列表
---
config/widgetM.json | 328 +++++++++++++++++++++++
js/indexM.js | 281 ++++++++++++++++++++
mobile/cars.html | 2
config/configM.json | 140 ++++++++++
cars.html | 58 ++++
5 files changed, 808 insertions(+), 1 deletions(-)
diff --git a/cars.html b/cars.html
new file mode 100644
index 0000000..8f425cf
--- /dev/null
+++ b/cars.html
@@ -0,0 +1,58 @@
+锘�<!DOCTYPE html>
+<html class="no-js css-menubar" lang="zh-cn">
+ <head>
+ <title>涓婃捣甯傞亾璺氦閫氱幆澧冪洃娴嬪钩鍙�</title>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+ <!-- 绉诲姩璁惧 viewport -->
+ <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui" />
+ <meta name="author" content="鐏槦绉戞妧 http://mars3d.cn " />
+ <!-- 360娴忚鍣ㄩ粯璁や娇鐢╓ebkit鍐呮牳 -->
+ <meta name="renderer" content="webkit" />
+ <!-- Chrome娴忚鍣ㄦ坊鍔犳闈㈠揩鎹锋柟寮忥紙瀹夊崜锛� -->
+ <link rel="icon" type="image/png" href="img/favicon/favicon.png" />
+ <meta name="mobile-web-app-capable" content="yes" />
+ <!-- Safari娴忚鍣ㄦ坊鍔犲埌涓诲睆骞曪紙IOS锛� -->
+ <link rel="icon" sizes="192x192" href="img/favicon/apple-touch-icon.png" />
+ <meta name="apple-mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-status-bar-style" content="black" />
+ <meta name="apple-mobile-web-app-title" content="鐏槦绉戞妧 MarsGIS" />
+ <!-- Win8鏍囬鏍忓強ICON鍥炬爣 -->
+ <link rel="apple-touch-icon-precomposed" href="img/favicon/apple-touch-icon.png" />
+ <meta name="msapplication-TileImage" content="img/favicon/app-icon72x72@2x.png" />
+ <meta name="msapplication-TileColor" content="#62a8ea" />
+
+ <!--绗笁鏂筶ib-->
+ <script
+ type="text/javascript"
+ src="lib/include-lib.js?time=20210803"
+ libpath="lib/"
+ include="jquery,jquery.range,bootstrap,bootstrap-checkbox,font-awesome,web-icons,layer,haoutil,localforage,nprogress,toastr,admui,turf,mars3d,mars3d-widget,mars3d-wind"
+ ></script>
+ <link href="css/style.css?time=20210803" rel="stylesheet" />
+ <link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
+ <link href="lib/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.css" rel="stylesheet" />
+ <script src="lib/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.js" ></script>
+ <script src="lib/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.zh-CN.js" ></script>
+ </head>
+
+ <body class="dark">
+ <div id="centerDiv">
+ <div id="mars3dContainer" class="mars3d-container"></div>
+ </div>
+
+ <div id="mask" class="signmask"></div>
+
+ <!--涓氬姟浠g爜-->
+ <script src="js/buffer.603.js"></script>
+ <script src="js/hmac-sha256.js"></script>
+ <script src="js/enc-base64-min.js"></script>
+ <script src="js/changable_params.js"></script>
+ <script src="js/function_1001.js"></script>
+ <script src="js/function_1004.js"></script>
+ <script src="js/function_wind.js"></script>
+ <script src="js/function.js"></script>
+ <script src="js/server.js"></script>
+ <script src="js/indexM.js"></script>
+ </body>
+</html>
diff --git a/config/configM.json b/config/configM.json
new file mode 100644
index 0000000..42c3495
--- /dev/null
+++ b/config/configM.json
@@ -0,0 +1,140 @@
+锘縶
+ "map3d": {
+ "templateValues": {
+ "dataServer": "//data.mars3d.cn",
+ "gltfServerUrl": "//data.mars3d.cn/gltf"
+ },
+ "scene": {
+ "center": {"lat":30.688954,"lng":121.481242,"alt":49845,"heading":359,"pitch":-40},
+ "scene3DOnly": false,
+ "shadows": false,
+ "removeDblClick": true,
+ "sceneMode": 3,
+ "showSun": true,
+ "showMoon": true,
+ "showSkyBox": true,
+ "showSkyAtmosphere": true,
+ "fog": true,
+ "fxaa": true,
+ "globe": {
+ "depthTestAgainstTerrain": false,
+ "baseColor": "#546a53",
+ "showGroundAtmosphere": true,
+ "enableLighting": false
+ },
+ "cameraController": {
+ "zoomFactor": 3.0,
+ "minimumZoomDistance": 1,
+ "maximumZoomDistance": 50000000,
+ "enableRotate": true,
+ "enableTranslate": true,
+ "enableTilt": true,
+ "enableZoom": true,
+ "enableCollisionDetection": true,
+ "minimumCollisionTerrainHeight": 15000
+ }
+ },
+ "control": {
+ "homeButton": false,
+ "baseLayerPicker": false,
+ "sceneModePicker": false,
+ "vrButton": false,
+ "fullscreenButton": true,
+ "navigationHelpButton": false,
+ "animation": true,
+ "timeline": false,
+ "infoBox": false,
+ "geocoder": false,
+ "geocoderConfig": { "key": ["ae29a37307840c7ae4a785ac905927e0"] },
+ "selectionIndicator": false,
+ "defaultContextMenu": true,
+ "mouseDownView": true,
+ "compass": { "bottom": "270px", "right": "5px" },
+ "distanceLegend": { "left": "150px", "bottom": "2px" },
+ "locationBar": {
+ "fps": false,
+ "crs": "CGCS2000_GK_Zone_3",
+ "crsDecimal": 0,
+ "template": "<div>缁忓害:{lng}</div> <div>绾害:{lat}</div> <div>娴锋嫈锛歿alt}绫�</div> <div>灞傜骇锛歿level}</div><div>鏂瑰悜锛歿heading}掳</div> <div>淇话瑙掞細{pitch}掳</div><div>瑙嗛珮锛歿cameraHeight}绫�</div>"
+ }
+ },
+ "terrain": {
+ "url": "{dataServer}/terrain",
+ "show": false
+ },
+ "basemaps": [
+ { "id": 10, "name": "鍦板浘搴曞浘", "type": "group" },
+ {
+ "id": 2021,
+ "pid": 10,
+ "name": "澶╁湴鍥惧奖鍍�",
+ "icon": "img/basemaps/tdt_img.png",
+ "type": "group",
+ "layers": [
+ { "name": "搴曞浘", "type": "tdt", "layer": "img_d", "key": ["51915011aa0997aa2ddd7e38504fa8bc"] }
+ ],
+ "show":true
+ },
+ {
+ "pid": 10,
+ "name": "澶╁湴鍥剧數瀛�",
+ "icon": "img/basemaps/tdt_vec.png",
+ "type": "group",
+ "layers": [
+ {
+ "name": "搴曞浘",
+ "type": "tdt",
+ "layer": "vec_d",
+ "key": ["51915011aa0997aa2ddd7e38504fa8bc"]
+ }
+ ],
+ "zIndex": 0
+ },
+ {
+ "pid": 10,
+ "name": "榛戣壊搴曞浘",
+ "icon": "img/basemaps/bd-c-dark.png",
+ "type": "group",
+ "layers": [
+ {
+ "name": "搴曞浘",
+ "type": "tdt",
+ "layer": "vec_d",
+ "brightness": 0.3,
+ "contrast": 1.8,
+ "gamma": 1,
+ "hue": 0,
+ "saturation": 0,
+ "key": ["51915011aa0997aa2ddd7e38504fa8bc"]
+ }
+ ],
+ "zIndex": 0
+ }
+ ],
+ "layers": [
+ { "id": 50, "name": "杈呭姪鍥惧眰", "type": "group" },
+ {
+ "pid": 50,
+ "name": "琛屾斂鍖哄垝鐣岀嚎",
+ "type": "xyz",
+ "url": "https://t{s}.tianditu.gov.cn/DataServer?T=ibo_w&x={x}&y={y}&l={z}&tk=51915011aa0997aa2ddd7e38504fa8bc",
+ "subdomains": "01234567",
+ "maximumLevel": 10,
+ "mapSplit": false,
+ "show": true
+ },
+ {
+ "pid": 50,
+ "name": "楂樺痉瀹炴椂璺喌",
+ "type": "gaode",
+ "layer": "time",
+ "minimumTerrainLevel": 4,
+ "minimumLevel": 4,
+ "proxy": "//server.mars3d.cn/proxy/",
+ "mapSplit": false
+ },
+ { "id": 99, "name": "鏁版嵁鍥惧眰", "type": "group" },
+ { "id": 1006, "pid": 99, "name": "鐩戞祴鍖哄煙", "type": "group" }
+ ]
+ }
+}
diff --git a/config/widgetM.json b/config/widgetM.json
new file mode 100644
index 0000000..b75f30d
--- /dev/null
+++ b/config/widgetM.json
@@ -0,0 +1,328 @@
+{
+ "version": "20210803",
+ "defaultOptions": {
+ "style": "dark",
+ "windowOptions": {
+ "skin": "layer-mars-dialog animation-scale-up",
+ "position": {
+ "top": 50,
+ "right": 10
+ },
+ "maxmin": false,
+ "resize": true
+ },
+ "autoReset": false,
+ "autoDisable": true,
+ "disableOther": true
+ },
+ "openAtStart": [
+ {
+ "name": "鏀惧ぇ缂╁皬鎸夐挳",
+ "uri": "widgets/toolButton/zoom.js"
+ }
+ ],
+ "widgets": [
+ {
+ "name": "鐩戞帶鎬昏",
+ "uri": "widgetsTS/widget_summary/widget.js"
+ },
+ {
+ "name": "鍒嗙被鏌ヨ",
+ "uri": "widgetsTS/widget_search/widget.js"
+ },
+ {
+ "name": "鐩戞帶璇︽儏",
+ "uri": "widgetsTS/widget_detail/widget.js"
+ },
+ {
+ "name": "妯℃澘-iframe寮圭獥",
+ "uri": "widgets/_example/widget.js",
+ "windowOptions": {
+ "width": 300,
+ "height": 400,
+ "position": {
+ "bottom": 10,
+ "right": 10
+ },
+ "maxmin": true,
+ "resize": true
+ },
+ "autoDisable": false,
+ "disableOther": false,
+ "openAtStart": false
+ },
+ {
+ "name": "妯℃澘-div寮圭獥",
+ "uri": "widgets/_example_divwin/widget.js"
+ },
+ {
+ "name": "妯℃澘-2涓脊绐�",
+ "uri": "widgets/_example_2win/widget.js"
+ },
+ {
+ "name": "妯℃澘-append妯℃澘",
+ "uri": "widgets/_example_append/widget.js"
+ },
+
+ {
+ "name": "鍦板浘鍒囨崲",
+ "uri": "widgets/manageBasemaps/widget.js",
+ "group": "forlayer",
+ "autoDisable": false,
+ "disableOther": false,
+ "windowOptions": {
+ "position": {
+ "top": 70,
+ "right": 60
+ }
+ }
+ },
+ {
+ "name": "鍥惧眰绠$悊",
+ "uri": "widgets/manageLayers/widget.js",
+ "group": "forlayer",
+ "autoCenter": true,
+ "windowOptions": {
+ "position": {
+ "top": 50,
+ "bottom": 30,
+ "right": 10
+ }
+ },
+ "css": {
+ "max-width": "300px"
+ },
+ "autoDisable": false,
+ "disableOther": false
+ },
+ {
+ "name": "鍥惧眰绠$悊New",
+ "uri": "widgets/manageLayers_style/widget.js",
+ "group": "forlayer",
+ "autoCenter": true,
+ "windowOptions": {
+ "position": {
+ "top": 70,
+ "bottom": 30,
+ "right": 60
+ }
+ },
+ "css": {
+ "max-width": "300px"
+ },
+ "autoDisable": false,
+ "disableOther": false
+ },
+ {
+ "name": "鍓栭潰鍒嗘瀽鍥捐〃",
+ "uri": "widgets/measureChars/widget.js",
+ "windowOptions": {
+ "noTitle": true,
+ "maxmin": false,
+ "position": {
+ "bottom": 30,
+ "left": 30,
+ "right": 60
+ }
+ },
+ "disableOther": false
+ },
+ {
+ "name": "瑙嗚涔︾",
+ "uri": "widgets/bookmark/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 50,
+ "bottom": 30,
+ "right": 10
+ }
+ }
+ },
+ {
+ "name": "婕父璺嚎璁剧疆",
+ "uri": "widgets/roamLine/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 45,
+ "bottom": 30,
+ "right": 5
+ }
+ }
+ },
+ {
+ "name": "婕父璺嚎",
+ "uri": "widgets/roamFly/widget.js",
+ "windowOptions": {
+ "position": {
+ "bottom": 60,
+ "right": 5
+ }
+ }
+ },
+ {
+ "name": "璺嚎鍓栭潰",
+ "uri": "widgets/roamChars/widget.js",
+ "windowOptions": {
+ "noTitle": true,
+ "position": {
+ "top": 10,
+ "left": 10,
+ "right": 10
+ }
+ },
+ "disableOther": false
+ },
+ {
+ "name": "鍗峰笜瀵规瘮",
+ "uri": "widgets/mapSplit/widget.js",
+ "group": "mapCompare",
+ "autoDisable": false,
+ "disableOther": false
+ },
+ {
+ "name": "鍙屽睆瀵规瘮",
+ "uri": "widgets/mapCompare/widget.js",
+ "autoDisable": false,
+ "disableOther": false,
+ "group": "mapCompare",
+ "windowOptions": {
+ "position": {
+ "top": 160,
+ "bottom": 40,
+ "left": 10
+ },
+ "maxmin": true
+ }
+ },
+ {
+ "name": "鐧惧害琛楁櫙",
+ "uri": "widgets/streetscape/widget.js",
+ "autoDisable": false,
+ "disableOther": false,
+ "group": "mapCompare",
+ "windowOptions": {
+ "position": {
+ "top": 160,
+ "bottom": 40,
+ "left": 10
+ },
+ "maxmin": true
+ }
+ },
+ {
+ "name": "鏍囩粯",
+ "uri": "widgets/plot/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 45,
+ "bottom": 30,
+ "right": 5
+ }
+ },
+ "openAtStart": false
+ },
+ {
+ "name": "妯″瀷搴�",
+ "uri": "widgets/plot-model/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 45,
+ "bottom": 30,
+ "right": 5
+ }
+ }
+ },
+ {
+ "name": "鍒嗙粍鍚嶇О缂栬緫",
+ "uri": "widgets/plotGroupName/widget.js",
+ "windowOptions": {
+ "position": "t"
+ },
+ "disableOther": false
+ },
+ {
+ "name": "灞炴�х紪杈�",
+ "uri": "widgets/plotAttr/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 60,
+ "bottom": 30,
+ "left": 10
+ }
+ },
+ "disableOther": false
+ },
+ {
+ "name": "璺嚎瀵艰埅",
+ "uri": "widgets/queryRoute/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 45,
+ "bottom": 30,
+ "right": 5
+ }
+ }
+ },
+ {
+ "name": "杞ㄨ抗鍥炴斁",
+ "group":"router",
+ "uri": "widgetsTS/taxiRouteReplay/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 45,
+ "bottom": 30,
+ "right": 5
+ }
+ },
+ "autoDisable":false
+ },
+{
+ "name": "杞ㄨ抗鍥炴斁",
+ "group":"router",
+ "uri": "widgetsTS/taxiRouteReplay2/widget.js",
+ "windowOptions": {
+ "position": {
+ "top": 45,
+ "bottom": 30,
+ "left": 5
+ }
+ },
+ "autoDisable":false
+ },
+ {
+ "name": "鎵撳嵃",
+ "uri": "widgets/print/widget.js",
+ "autoDisable": false,
+ "disableOther": false
+ },
+ {
+ "name": "椋庡満鍙傛暟",
+ "uri": "widgetsTS/windsetting/widget.js",
+ "autoDisable":false,
+ "windowOptions": {
+ "position": {
+ "top": 185,
+ "left": 5
+ }
+ }
+ },
+ {
+ "name": "鐩戞帶缃戞牸",
+ "uri": "widgetsTS/widget_grid/widget.js",
+ "autoDisable":false,
+ "windowOptions": {
+ "position": {
+ "top": 185,
+ "left": 5
+ }
+ }
+ },
+ {
+ "name": "鍦板浘鍥句緥",
+ "uri": "widgetsTS/tuglie/widget.js",
+ "autoDisable":false
+
+ }
+
+ ]
+}
diff --git a/js/indexM.js b/js/indexM.js
new file mode 100644
index 0000000..7f448cd
--- /dev/null
+++ b/js/indexM.js
@@ -0,0 +1,281 @@
+"use script"; //寮�鍙戠幆澧冨缓璁紑鍚弗鏍兼ā寮�
+//绯荤粺涓诲叆鍙�
+
+var map; //鍦扮悆瀵硅薄
+var request; //浼犲叆鐨刧et鍙傛暟
+var geoJsonLayer;
+
+//鍦板浘
+$(document).ready(function () {
+ //鍒ゆ柇webgl鏀寔
+ if (!mars3d.Util.webglreport()) {
+ mars3d.Util.webglerror();
+ }
+
+ //璁板綍url浼犲叆鍙傛暟
+ request = haoutil.system.getRequest();
+ if (window.top) {
+ //鏈夌埗绾�
+ request = $.extend(request, haoutil.system.getRequest(window.top));
+ }
+
+ // try {
+ // var jwtstr = request.JWT;
+ // var strs_ = jwtstr.split('.');
+ // var jwt_header_ = new buffer.Buffer(strs_[0].toString('base64'), 'base64').toString();
+ // var jwt_payload_ = new buffer.Buffer(strs_[1].toString('base64'), 'base64').toString();
+ // var payload_ = JSON.parse(jwt_payload_);
+ // mars3d.global_variables.userid = payload_.userid;
+ // mars3d.global_variables.regionCode = payload_.divcode;
+ // var hash = CryptoJS.HmacSHA256(strs_[0] + '.' + strs_[1], "sxyd");
+ // var hashInBase64 = base64UrlEncode(hash);
+
+ // var reg = RegExp(strs_[2]);
+ // if (!reg.exec(hashInBase64)) {
+ // // verification failed, go back
+ // window.top.location = mars3d.global_variables.un_authorization_url;
+ // }
+ // payload_ = JSON.parse(jwt_payload_);
+ // if (!payload_ || !payload_.expires) {
+ // // verification error ,go back
+ // window.top.location = mars3d.global_variables.un_authorization_url;
+ // }
+ // var date1 = new Date(payload_.expires);
+ // var date2 = new Date();
+ // if (date1 < date2) {
+ // // expire, go back
+ // window.top.location = mars3d.global_variables.un_authorization_url;
+ // }
+ // }
+ // catch (err) {
+ // window.top.location = mars3d.global_variables.un_authorization_url;
+ // }
+
+ if(!mars3d.global_variables.userid) {
+ mars3d.global_variables.userid = 2;
+ }
+ regionCode = mars3d.global_variables.regionCode
+
+ var configfile = "config/configM.json"; //榛樿鍦板潃
+ if (request.config) {
+ //url浼犲叆鍦板潃
+ configfile = request.config;
+ }
+
+ haoutil.loading.show();
+
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url: configfile,
+ timeout: 0,
+ success: function (data) {
+ haoutil.loading.hide();
+
+ //鏋勫缓鍦板浘
+ initMap(data.map3d);
+
+ setTimeout(removeMask, 3000); //娆㈣繋UI鍏抽棴澶勭悊
+ },
+ error: function (request, textStatus) {
+ removeMask();
+ haoutil.loading.hide();
+ haoutil.alert("1.璇锋鏌ユ枃浠跺唴 json 璇硶鏄惁瀛樺湪闂銆�<br />2.璇峰湪娴忚鍣ㄨ緭鍏ユ枃浠秛rl娴嬭瘯鏄惁鍙互璁块棶銆�", configfile + " 鏂囦欢鍔犺浇澶辫触");
+ console.log(textStatus, request);
+ },
+ });
+
+ initUI();
+});
+
+function removeMask() {
+ $("#mask").remove();
+}
+
+//UI鐣岄潰鐩稿叧
+function initUI() {
+ haoutil.oneMsg("棣栨璁块棶绯荤粺鏃犵紦瀛樹細鐣ユ參锛岃鑰愬績绛夊緟锛�", "load3d_tip");
+}
+
+//鍒濆鍖栧湴鍥�
+function initMap(mapOptions) {
+ //鍚堝苟灞炴�у弬鏁帮紝鍙鐩朿onfig.json涓殑瀵瑰簲閰嶇疆
+ // mapOptions = mars3d.Util.merge(mapOptions, {})
+
+ //鍒涘缓涓夌淮鍦扮悆鍦烘櫙
+ map = new mars3d.Map("mars3dContainer", mapOptions);
+
+
+ //鏋勯�爓idget
+ initWidget(map);
+
+ initLayersByUserid();
+
+
+ //濡傛灉鏈墄yz浼犲弬锛岃繘琛屽畾浣�
+ if (haoutil.isutil.isNotNull(request.x) && haoutil.isutil.isNotNull(request.y)) {
+ map.setCameraView(request, { duration: 0, isWgs84: true });
+ }
+
+ //寮�鍦哄姩鐢�
+ //map.openFlyAnimation();
+
+ //閽堝涓嶅悓缁堢鐨勪紭鍖栭厤缃�
+ if (haoutil.system.isPCBroswer()) {
+ // Cesium 1.61浠ュ悗浼氶粯璁ゅ叧闂弽璧版牱锛屽浜庢闈㈢鑰岃█杩樻槸寮�鍚緱濂斤紝
+ map.scene.postProcessStages.fxaa.enabled = true;
+
+ //榧犳爣婊氳疆鏀惧ぇ鐨勬闀垮弬鏁�
+ map.scene.screenSpaceCameraController._zoomFactor = 2.0;
+
+ //IE娴忚鍣ㄤ紭鍖�
+ if (window.navigator.userAgent.toLowerCase().indexOf("msie") >= 0) {
+ map.viewer.targetFrameRate = 20; //闄愬埗甯х巼
+ map.viewer.requestRenderMode = true; //鍙栨秷瀹炴椂娓叉煋
+ }
+ } else {
+ //榧犳爣婊氳疆鏀惧ぇ鐨勬闀垮弬鏁�
+ map.scene.screenSpaceCameraController._zoomFactor = 5.0;
+
+ //绉诲姩璁惧涓婄鎺変互涓嬪嚑涓�夐」锛屽彲浠ョ浉瀵规洿鍔犳祦鐣�
+ map.viewer.requestRenderMode = true; //鍙栨秷瀹炴椂娓叉煋
+ map.scene.fog.enabled = false;
+ map.scene.skyAtmosphere.show = false;
+ map.scene.globe.showGroundAtmosphere = false;
+ }
+
+ //浜屼笁缁村垏鎹笉鐢ㄥ姩鐢�
+ if (map.sceneModePicker) {
+ map.sceneModePicker.viewModel.duration = 0.0;
+ }
+
+ //webgl娓叉煋澶辫触鍚庯紝鍒锋柊椤甸潰
+ // map.on(mars3d.EventType.renderError, function (scene, error) {
+ // window.location.reload();
+ // });
+
+ //缁戝畾鍗曞嚮鏄剧ずBIM鐨勬瀯浠舵爲
+ bindShowTilesParts();
+
+ //涓嬮潰鍙互缁х画鍔犻」鐩浉鍏崇殑鍏朵粬浠g爜
+}
+
+//鍒濆鍖杦idget鐩稿叧
+function initWidget(map) {
+ haoutil.loading.show();
+
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url: "config/widgetM.json",
+ timeout: 0,
+ success: function (widgetCfg) {
+ haoutil.loading.hide();
+
+ //url濡傛灉鏈変紶鍙傛椂鐨勫鐞�
+ if (haoutil.isutil.isNotNull(request.widget)) {
+ if (request.onlyStart) {
+ widgetCfg.openAtStart = [];
+ }
+ widgetCfg.openAtStart.push({
+ uri: request.widget,
+ name: request.name || "",
+ windowOptions: {
+ closeBtn: !request.onlyStart,
+ },
+ request: request,
+ });
+ map.flyHome({ duration: 0 });
+ }
+
+ //鍒濆鍖杦idget绠$悊鍣�
+ mars3d.widget.init(map, widgetCfg, "./"); //tip: 绗�3涓弬鏁版敮鎸佸畾涔墂idget鐩綍鐨勭浉瀵硅矾寰勩��
+
+ if (window.lastWidgetItem) {
+ activateWidget(lastWidgetItem);
+ lastWidgetItem = null;
+ }
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ haoutil.loading.hide();
+ haoutil.alert("config/widget.json鏂囦欢鍔犺浇澶辫触锛�");
+ },
+ });
+
+ //widget鐩稿叧浜嬩欢鐩戝惉
+ // mars3d.widget.on(mars3d.widget.EventType.load, function (event) {
+ // console.log("寮曞叆鍔犺浇浜唚idget鐨刯s", event);
+ // })
+ // mars3d.widget.on(mars3d.widget.EventType.beforeCreate, function (event) {
+ // console.log("涓嶅垱寤簑idet", event);
+ // })
+
+ mars3d.widget.on(mars3d.widget.EventType.activated, function (event) {
+ console.log("婵�娲讳簡widget", event);
+ });
+ mars3d.widget.on(mars3d.widget.EventType.disabled, function (event) {
+ console.log("閲婃斁浜唚idget", event);
+ });
+}
+
+//bim鏋勪欢鐨勫鐞�
+function bindShowTilesParts() {
+ //鍗曞嚮鍦板浘浜嬩欢
+ map.on(mars3d.EventType.clickGraphic, function (event) {
+ if (!(event.pickedObject instanceof Cesium.Cesium3DTileFeature)) {
+ //涓嶆槸BIM鏁版嵁鏃惰烦鍑�
+ return;
+ }
+
+ let layer = event.layer;
+ if (!layer.options.scenetree) {
+ //鏈厤缃畇cenetree鏃惰烦鍑�
+ return;
+ }
+
+ var tilesParts = "widgets/tilesParts/widget.js";
+
+ if (mars3d.widget.isActivate(tilesParts)) {
+ var parts = mars3d.widget.getClass(tilesParts);
+ if (parts.config.layerCfg == layer.options) {
+ //褰撳墠宸叉縺娲�,骞朵笖鍗曞嚮浜嗙浉鍚屾ā鍨嬫椂璺冲嚭
+ return;
+ }
+ }
+
+ mars3d.widget.activate({
+ name: layer.name + " 鏋勪欢",
+ uri: tilesParts,
+ layerCfg: layer.options,
+ disableOther: false,
+ });
+ });
+}
+
+//澶栭儴椤甸潰璋冪敤
+var lastWidgetItem;
+function activateWidget(item) {
+ if (!map) {
+ lastWidgetItem = item;
+ return;
+ }
+ mars3d.widget.activate(item);
+}
+function disableWidget(item) {
+ mars3d.widget.disable(item);
+}
+function activateFunByMenu(fun) {
+ eval(fun);
+}
+
+function goHome() {
+ mars3d.widget.disableAll();
+ map.flyHome();
+}
+
+function base64UrlEncode(str) {
+ var encodedSource = CryptoJS.enc.Base64.stringify(str);
+ var reg = new RegExp('/', 'g');
+ encodedSource = encodedSource.replace(/=+$/,'').replace(/\+/g,'-').replace(reg,'_');
+ return encodedSource;
+}
diff --git a/mobile/cars.html b/mobile/cars.html
index d89bdc5..f0bde4a 100644
--- a/mobile/cars.html
+++ b/mobile/cars.html
@@ -34,7 +34,7 @@
</div>
<div class="main">
- aa
+ <iframe src="../cars.html" width="100%" height="100%" iframeborder="0"></iframe>
</div>
<div class="footbar">
--
Gitblit v1.9.1