本文共 996 字,大约阅读时间需要 3 分钟。
服务器端处理//在地图上单击画点
var map = $find('Map1');
map.getGeometry(ESRI.ADF.Graphics.ShapeType.Point, usePoint, null, 'red', '#0000FF', 'pointer', true);
//获取鼠标点击的位置的地图坐标
function usePoint(clickPoint)
{//地理坐标转到屏幕坐标
var screenPoint=map.toScreenPoint(clickPoint);//获取屏幕坐标的X和Y分量
var screenX=screenPoint.offsetX;
var screenY=screenPoint.offsetY;
}
//屏幕坐标转到地理坐标
function ToMapXY(screenX,screenY)
{ var map = $find('Map1');//返回 ESRI.ADF.Geometries.Point 类型的点
var mapPoint=map.toMapPoint(screenX,screenY);}
转载地址:http://eflcn.baihongyu.com/