src/components/campusNav/index.vue
@@ -59,6 +59,12 @@
                    <el-button @click="startNavigation" type="primary">导航</el-button>
                </div>
            </div>
            <div class="path-box" v-show="pathBoxShow">
                <ul>
                    <li v-for="(item, index) in pathBoxList" :key="index">{{item.instruction}}</li>
                </ul>
            </div>
        </template>
    </public-box>
</template>
@@ -87,6 +93,9 @@
            butChouse: '',
            startLayer: null,
            endLayer: null,
            pathBoxShow: false,
            pathBoxList: [],
            isOverRouter: false // 是否启用了导航
        }
@@ -201,7 +210,7 @@
            tooltip.enable = true
            let title = ''
            if (val == 'start') {
                title = '点击放置起点'
                title = '点击选择起点'
                // 初始化图标图层
                if (this.startLayer == null) {
                    this.startLayer = new this.DC.VectorLayer('startLayer')
@@ -210,7 +219,7 @@
                    this.startLayer.clear()
                }
            } else if (val == 'end') {
                title = '点击放置终点'
                title = '点击选择终点'
                // 初始化图标图层
                if (this.endLayer == null) {
                    this.endLayer = new this.DC.VectorLayer('endLayer')
@@ -386,7 +395,11 @@
                            })
                        }
                        this.pathBoxList = []
                        res.data.route.paths[0].steps.forEach((item) => {
                            this.pathBoxList.push({ instruction: item.instruction, orientation: item.orientation, action: item.action })
                            item.polyline = item.polyline.split(';')
                            var lineArr = []
@@ -405,6 +418,8 @@
                            routes += lineArr
                        })
                        this.pathBoxShow = true
                        routes =
                            startLog + ',' + startLat + ';' + routes + endLog + ',' + endLat