view.on("pointer-move", event => { //监听pointer-move事件
const point = view.toMap({x:event.x,y:event.y}); //将鼠标的像素位置转为经纬度
const lon = Math.round(point.x * 1000) / 1000; //经纬度保留小数位
const lat = Math.round(point.y * 10000 / 1000;
this.currentPosition = `lon: ${lon}, lat:${lat}`;
}
arcgis获取鼠标当前位置的经纬度
最新推荐文章于 2024-03-21 16:36:19 发布