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参数),在手机上可以看出效果

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐