地图坐标怎么转为屏幕坐标

 FeatureLayer.DisplayTransform.ToDisplay
或者
Map.DisplayTransform.ToDisplay

具体使用

把点击的坐标记录到隐藏文本框

function cc()
{
document.Form1.iPoint.Value=event.x+ '|' + event.y;
document.Form1.txtSpotType.value=document.Form1.iPoint.Value;
Form1.submit();
}

————————————————————————————————————

转换下哈

    if(this.txtSpotType.Value.Length!=0)
   {
    string []point;
    int screenX = -1;
    int screenY = -1;

    point = txtSpotType.Value.Split('|');

    try
    {
     screenX = Convert.ToInt32(point[0]);
     screenY = Convert.ToInt32(point[1]);
    }
    catch(Exception)
    {
    }

    if ( screenX >= 0 && screenY >= 0 )
    {
     System.Drawing.Point pntClick = new System.Drawing.Point(screenX,screenY);
     DPoint pntCenter = new DPoint(0,0);
     this.MapControl1.Map.DisplayTransform.FromDisplay(pntClick, out pntCenter);
     this.MapControl_PL.Map.Center = pntCenter;
    }
    txtSpotType.Value = "";
   }

你可能感兴趣的:(地图坐标怎么转为屏幕坐标)