Commit afe2450a14a918180a7b96e194a0e98130317517

Authored by 648540858
1 parent ee62f171

优化地图功能的开关

web_src/index.html
... ... @@ -12,26 +12,7 @@
12 12 <script type="text/javascript" src="./static/js/jessibuca/jessibuca.js"></script>
13 13 <script type="text/javascript" src="./static/js/EasyWasmPlayer.js"></script>
14 14 <script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script>
  15 + <script type="text/javascript" src="./static/js/mapConfig.js"></script>
15 16 <div id="app"></div>
16   - <!-- built files will be auto injected -->
17   - <script>
18   - // map组件全局参数, 注释此内容可以关闭地图功能
19   - window.mapParam = {
20   - // 坐标系 GCJ-02 WGS-84,
21   - coordinateSystem: "GCJ-02",
22   - // 地图瓦片地址
23   - tilesUrl: "http://webrd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8",
24   - // 瓦片大小
25   - tileSize: 256,
26   - // 默认层级
27   - zoom:10,
28   - // 默认地图中心点
29   - center:[116.41020, 39.915119],
30   - // 地图最大层级
31   - maxZoom:18,
32   - // 地图最小层级
33   - minZoom: 3
34   - }
35   - </script>
36 17 </body>
37 18 </html>
... ...
web_src/src/components/devicePosition.vue
... ... @@ -59,7 +59,7 @@ export default {
59 59 },
60 60 data() {
61 61 return {
62   - onOff: typeof window.mapParam !== "undefined",
  62 + onOff: typeof window.mapParam !== "undefined" && window.mapParam.enable,
63 63 deviceService: new DeviceService(),
64 64 layer: null,
65 65 lineLayer: null,
... ...
web_src/static/js/mapConfig.js 0 → 100644
  1 +// map组件全局参数, 注释此内容可以关闭地图功能
  2 +window.mapParam = {
  3 + // 开启/关闭地图功能
  4 + enable: true,
  5 + // 坐标系 GCJ-02 WGS-84,
  6 + coordinateSystem: "GCJ-02",
  7 + // 地图瓦片地址
  8 + tilesUrl: "http://webrd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8",
  9 + // 瓦片大小
  10 + tileSize: 256,
  11 + // 默认层级
  12 + zoom:10,
  13 + // 默认地图中心点
  14 + center:[116.41020, 39.915119],
  15 + // 地图最大层级
  16 + maxZoom:18,
  17 + // 地图最小层级
  18 + minZoom: 3
  19 +}
... ...