使用map组件中的基本属性,以及MapContext.getScale方法商用是否需要付费?
<map id="map" ref="map" style="width: 100%; height: 100%;" :latitude="latitude" :longitude="longitude"
@labeltap="markertap" :show-scale='true' :scale="scale" :markers="markers">
</map>
this.mapContext = uni.createMapContext("map", this);
// 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {})
let that = this
setInterval(() => {
that.mapContext.getScale({
success: function(res) {
that.zoom = res.scale
console.log(that.zoom)
},
fail: function(error) {
console.log('获取地图缩放级别失败:', error);
}
});
}, 500)
不用