6***@qq.com
6***@qq.com
  • 发布:2020-11-10 11:54
  • 更新:2020-11-12 18:04
  • 阅读:1359

【报Bug】高德地图间的路线规划数据给<map>组件中的include-points属性 在app中显示无效(安卓和ios都是无效),在h5中显示正常

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15.7

HBuilderX类型: 正式

HBuilderX版本号: 2.9.7

手机系统: iOS

手机系统版本号: IOS 14

手机厂商: 苹果

手机机型: iPhoneSE

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<map id="map" ref="map" :style="{width: '750rpx', height: mapHeight + 'px'}"  
			:latitude="latitude" :longitude="longitude" :markers="markers"  
			:polyline="polyline" :include-points="points">  
		</map>  
 
import amap from '@/common/js/amap-wx'  
	const amapPlugin = new amap.AMapWX({ key: '' })  
 
 
data() {  
			return {  
				cardHeight: 352,  
				mapHeight: 1334,  
				latitude: 39.909,  
				longitude: 116.39742,  
				points: [],  
				polyline: [],  
				markers: []  
			}  
		},  
 
amapPlugin.getDrivingRoute({  
					origin: this.sendAddressInfo.longitude+','+this.sendAddressInfo.latitude,  
					destination: this.receiptAddressInfo.longitude+','+this.receiptAddressInfo.latitude,  
					success: (res)=>{  
						console.log(res);  
						if(res.paths && res.paths[0] && res.paths[0].steps){  
							const steps = res.paths[0].steps;  
							for(let i = 0; i < steps.length; i++){  
								const poLen = steps[i].polyline.split(';')  
								for(let j = 0;j < poLen.length; j++){  
									this.points.push({  
										longitude: parseFloat(poLen[j].split(',')[0]),  
										latitude: parseFloat(poLen[j].split(',')[1])  
									})  
								}   
							}  
						}  
						this.polyline = [  
							{  
								width: 8,  
								points: this.points,  
								color: '#0D85FA',  
								arrowLine: true  
							}  
						]  
						// console.log(this.polyline)  
					}  
				})  

操作步骤:

通过微信小程序高德地图sdk拿到两个坐标之间的路线规划数据给<map>组件中的include-points属性 在app中显示无效(安卓和ios都是无效),在h5中显示正常

预期结果:

显示 - 缩放视野以包含所有给定的坐标点

实际结果:

不显示 - 缩放视野以包含所有给定的坐标点

bug描述:

通过微信小程序高德地图sdk拿到两个坐标之间的路线规划数据给<map>组件中的include-points属性 在app中显示无效(安卓和ios都是无效),在h5中显示正常

2020-11-10 11:54 负责人:DCloud_App_Array 分享
已邀请:
6***@qq.com

6***@qq.com (作者)

官方不都关注吗?

DCloud_iOS_XHY

DCloud_iOS_XHY

你可以运行 uni-app 示例工程, 接口 - 位置 - 地图控制 有示例,测试没有问题,如果你使用有问题,请提供一个可以复现此问题的完整 demo 工程

该问题目前已经被锁定, 无法添加新回复