this.mapCtx = uni.createMapContext("map");
this.mapCtx.includePoints({
points: [{
latitude: this.form.fromLatitude,
longitude: this.form.fromLongitude
}, {
latitude: this.form.toLatitude,
longitude: this.form.toLongitude
}],
padding: [ 170, 170, 170, 170 ]
});
我使用了createMapContext中的includePoints方法设置padding的值去修改缩放,(开发者工具暂不支持padding参数),在手机上可以看出效果