使用MapContext的includePoints没有任何效果
- 发布:2019-05-09 20:14
- 更新:2020-11-13 11:34
- 阅读:4161
4***@qq.com - 菜鸡一只
==》 可行的
console.log("allpoints," ,allpoints);
this.mainMap.includePoints({
points:allpoints,
padding: [20,20,20,20]
});
allpoints实际上长这样的: [{latitude: 22.622656, longitude: 114.07805},{latitude: 22.622559, longitude: 114.07804}, {latitude: 22.622545, longitude: 114.078} , {latitude: 30.25961, longitude: 120.13026}]
log是这样的:
allpoints, (4) [{…}, {…}, {…}, {…}]0: {latitude: 22.622656, longitude: 114.07805}1: {latitude: 22.622559, longitude: 114.07804}2: {latitude: 22.622545, longitude: 114.078}3: {latitude: 30.25961, longitude: 120.13026}
app平台目前不支持,已列为需求
-
回复 7***@qq.com: nvue已支持,参考文档 https://uniapp.dcloud.io/api/location/map?id=createmapcontext
2019-09-05 10:48
全栈老哥
不行啊 大哥
2019-05-17 16:51
1***@qq.com
这块编译到微信小程序就直接报错了 试了下 是能用一个
this.mapCtx.includePoints({
padding: [10],
points: [{latitude: 0, longitude: 0}]
});
这样就不报错
this.mapCtx.includePoints({
padding: [10],
points: [{latitude: 0, longitude: 0},{latitude: 0, longitude: 0}]
});
多加一个坐标就报错了
2019-06-08 13:48