view.on("pointer-move", function (event) {
view.when(function () {
var screenPoint = {
x: event.x,
y: event.y
};
var mapPoint = view.toMap(screenPoint);
// 在页面中显示经纬度
document.getElementById("slgtd").innerHTML = mapPoint.longitude.toFixed(6);
document.getElementById("slttd").innerHTML = mapPoint.latitude.toFixed(6);
//document.getElementById("coordinates").innerText = "经度: " + mapPoint.longitude + ",纬度: " + mapPoint.latitude;
});
});
arcgis api 鼠标移动显示经纬度
最新推荐文章于 2024-07-14 09:41:15 发布