| | |
| | | <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> |
| | |
| | | butChouse: '', |
| | | startLayer: null, |
| | | endLayer: null, |
| | | |
| | | pathBoxShow: false, |
| | | pathBoxList: [], |
| | | |
| | | isOverRouter: false // 是否启用了导航 |
| | | } |
| | |
| | | tooltip.enable = true |
| | | let title = '' |
| | | if (val == 'start') { |
| | | title = '点击放置起点' |
| | | title = '点击选择起点' |
| | | // 初始化图标图层 |
| | | if (this.startLayer == null) { |
| | | this.startLayer = new this.DC.VectorLayer('startLayer') |
| | |
| | | this.startLayer.clear() |
| | | } |
| | | } else if (val == 'end') { |
| | | title = '点击放置终点' |
| | | title = '点击选择终点' |
| | | // 初始化图标图层 |
| | | if (this.endLayer == null) { |
| | | this.endLayer = new this.DC.VectorLayer('endLayer') |
| | |
| | | }) |
| | | } |
| | | |
| | | 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 = [] |
| | |
| | | routes += lineArr |
| | | }) |
| | | |
| | | this.pathBoxShow = true |
| | | |
| | | routes = |
| | | startLog + ',' + startLat + ';' + routes + endLog + ',' + endLat |
| | | |