From afe2450a14a918180a7b96e194a0e98130317517 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 06 五月 2022 16:01:36 +0800 Subject: [PATCH] 优化地图功能的开关 --- web_src/src/components/devicePosition.vue | 2 +- web_src/static/js/mapConfig.js | 19 +++++++++++++++++++ web_src/index.html | 21 +-------------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/web_src/index.html b/web_src/index.html index f69f16b..21ad271 100644 --- a/web_src/index.html +++ b/web_src/index.html @@ -12,26 +12,7 @@ <script type="text/javascript" src="./static/js/jessibuca/jessibuca.js"></script> <script type="text/javascript" src="./static/js/EasyWasmPlayer.js"></script> <script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script> + <script type="text/javascript" src="./static/js/mapConfig.js"></script> <div id="app"></div> - <!-- built files will be auto injected --> - <script> - // map缁勪欢鍏ㄥ眬鍙傛暟, 娉ㄩ噴姝ゅ唴瀹瑰彲浠ュ叧闂湴鍥惧姛鑳� - window.mapParam = { - // 鍧愭爣绯� GCJ-02 WGS-84, - coordinateSystem: "GCJ-02", - // 鍦板浘鐡︾墖鍦板潃 - tilesUrl: "http://webrd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8", - // 鐡︾墖澶у皬 - tileSize: 256, - // 榛樿灞傜骇 - zoom:10, - // 榛樿鍦板浘涓績鐐� - center:[116.41020, 39.915119], - // 鍦板浘鏈�澶у眰绾� - maxZoom:18, - // 鍦板浘鏈�灏忓眰绾� - minZoom: 3 - } - </script> </body> </html> diff --git a/web_src/src/components/devicePosition.vue b/web_src/src/components/devicePosition.vue index 16675c9..db19677 100644 --- a/web_src/src/components/devicePosition.vue +++ b/web_src/src/components/devicePosition.vue @@ -59,7 +59,7 @@ }, data() { return { - onOff: typeof window.mapParam !== "undefined", + onOff: typeof window.mapParam !== "undefined" && window.mapParam.enable, deviceService: new DeviceService(), layer: null, lineLayer: null, diff --git a/web_src/static/js/mapConfig.js b/web_src/static/js/mapConfig.js new file mode 100644 index 0000000..60427e8 --- /dev/null +++ b/web_src/static/js/mapConfig.js @@ -0,0 +1,19 @@ +// map缁勪欢鍏ㄥ眬鍙傛暟, 娉ㄩ噴姝ゅ唴瀹瑰彲浠ュ叧闂湴鍥惧姛鑳� +window.mapParam = { + // 寮�鍚�/鍏抽棴鍦板浘鍔熻兘 + enable: true, + // 鍧愭爣绯� GCJ-02 WGS-84, + coordinateSystem: "GCJ-02", + // 鍦板浘鐡︾墖鍦板潃 + tilesUrl: "http://webrd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8", + // 鐡︾墖澶у皬 + tileSize: 256, + // 榛樿灞傜骇 + zoom:10, + // 榛樿鍦板浘涓績鐐� + center:[116.41020, 39.915119], + // 鍦板浘鏈�澶у眰绾� + maxZoom:18, + // 鍦板浘鏈�灏忓眰绾� + minZoom: 3 +} -- Gitblit v1.8.0