let position = this.map.getCenter();
this.$ownerInstance.callMethod('savePoint', { // 调用 Vue 组件中的方法
position
});
//转换屏幕坐标
var pixel = this.map.lngLatToContainer(position);
this.$ownerInstance.callMethod('saveMap', { // 调用 Vue 组件中的方法
pixel
});
//在页面中 pixel 这个就是返回的坐标
<image src="/static/poi-marker-default.png" mode="aspectFit"
:style="'width:30px;height:30px;position: absolute; top:' + (pixel[1] - 27) + 'px; left: ' + (pixel[0] - 14) + 'px;'">
</image>