校园-江西科技师范大学-前端
shuishen
2023-12-08 71fa6546c0ff5822bdf1e950f637a603a515f529
移动端路网
3 files modified
68 ■■■■■ changed files
src/components/mobileWindow/index.vue 26 ●●●● patch | view | raw | blame | history
src/components/mobilemap/index.vue 4 ●●● patch | view | raw | blame | history
src/store/modules/mobile.js 38 ●●●●● patch | view | raw | blame | history
src/components/mobileWindow/index.vue
@@ -390,11 +390,11 @@
                        name: '显示活动'
                    })
                    // 暂时关闭去这的功能
                    // if (queryData.notAddGoOn == 'notAddGoOn') {
                    //     this.seebut.push({
                    //         name: '去这'
                    //     })
                    // }
                    if (queryData.notAddGoOn == 'notAddGoOn') {
                        this.seebut.push({
                            name: '去这'
                        })
                    }
                }
                for (const k in this.seebut) {
                    if (this.seebut[k].name == '定位') {
@@ -402,11 +402,11 @@
                    }
                }
                // 暂时关闭去这的功能
                // if (queryData.notAddGoOn != 'notAddGoOn') {
                //     this.seebut.push({
                //         name: '去这'
                //     })
                // }
                if (queryData.notAddGoOn != 'notAddGoOn') {
                    this.seebut.push({
                        name: '去这'
                    })
                }
            } else {
                this.seebut = [
                    // {
@@ -415,9 +415,9 @@
                    {
                        name: '图集'
                    },
                    // {
                    //     name: '去这'
                    // }
                    {
                        name: '去这'
                    }
                ]
            }
src/components/mobilemap/index.vue
@@ -42,7 +42,7 @@
        <!-- 实景窗口 -->
        <mobilePanorama></mobilePanorama>
        <!-- 退出导航 -->
        <mobileCloseRouter></mobileCloseRouter>
        <mobileCloseRouter ref="MobileCloseRouter"></mobileCloseRouter>
        <!-- 退出活动 -->
        <mobileCloseRouterMany></mobileCloseRouterMany>
        <!-- 活动窗口 -->
@@ -173,6 +173,8 @@
        campusValue: {
            handler (newData) {
                this.$nextTick(() => {
                    this.$refs.MobileCloseRouter.mobileRouterClose()
                    this.campusCut(newData)
                    this.$refs.mobileLeftNav.initialize(newData)
src/store/modules/mobile.js
@@ -17,6 +17,7 @@
import { Icon, Style, Fill, Text, Stroke } from "ol/style.js";
import openlayerData from "./openlayerData";
import mobilePosition from "./mobilePosition";
window.popupsDom = null; // mobileDivForms的实体类
window.flytoPosition = null; // mobileDivForms的实体类
@@ -57,6 +58,17 @@
// window.newLayer = null;
// window.usetowpointfive = null;
let pathUrl = [
  {
    key: 1,
    url: "https://fkxt.jxstnu.edu.cn/changjing/arcgis155/rest/services/hjzlw/NAServer/%E8%B7%AF%E5%BE%84/solve",
  },
  {
    key: 2,
    url: "https://fkxt.jxstnu.edu.cn/changjing/arcgis155/rest/services/fllw/NAServer/%E8%B7%AF%E5%BE%84/solve",
  },
];
const mobile = {
  state: {
@@ -893,10 +905,10 @@
        Number(val.end[1]).toFixed(6),
      ]; // 导航终点
      // 获取路径
      const url =
        "https://dev.jxpskj.com:8023/arcgis/rest/services/jglw/NAServer/%E8%B7%AF%E5%BE%84/solve"; // 默认api步行
      // const url = 'https://dev.jxpskj.com:8023/arcgis/rest/services/testroad/NAServer/%E8%B7%AF%E5%BE%84/solve' // 默认api步行
      let curPath = pathUrl.find(
        (item) => item.key == mobilePosition.state.currentCampus
      );
      const data = {
        stops: {
          features: [
@@ -919,7 +931,7 @@
        f: "json",
      };
      axios
        .get(url, {
        .get(curPath.url, {
          params: {
            ...data,
          },
@@ -927,11 +939,11 @@
        .then((res) => {
          // 回调
          let Str = ""; // 加入起点
          res.data.routes.features[0].geometry.paths[0].forEach((item) => {
            Str += `${item[0]},${item[1]};`;
          });
          // Str += state.navigationEndLngLat.join(',') // 加入终点
          let Str = res.data.routes.features[0].geometry.paths[0].map(
            (item) => {
              return [item[0], item[1]];
            }
          );
          if (val.fn) {
            const dataS = {
@@ -959,11 +971,7 @@
      });
      openlayerData.state.openlayers.map2D.addLayer(window.drawALineLayer);
      const lineCoordinates = value
        .split(";")
        .map((item) => item.split(",").map((i) => Number(i)));
      const line = new LineString(lineCoordinates);
      const line = new LineString(value);
      const style = new Style({
        stroke: new Stroke({