ArcGIS API for Silverlight 鼠标移动显示地理坐标

<esri:Map x:Name="myMap"  ExtentChanged="myMap_ExtentChanged" WrapAround="True" IsLogoVisible="False" 
                  Extent="117.112306799734,29.3397854999517,118.981519200236,30.5753385000024"  MouseMove="myMap_MouseMove">
    <esri:Map.Layers>
         <esri:ArcGISDynamicMapServiceLayer ID="MyLayer"  Url="http://192.168.0.89/arcgis/rest/services/HSDynamic/MapServer/"/>
    </esri:Map.Layers>
</esri:Map>

#region 处理鼠标在地图上移动时,显示地理坐标

private void myMap_MouseMove(object sender, System.Windows.Input.MouseEventArgs args)
{
     if (myMap.Extent != null)
     {
          System.Windows.Point screenPoint = args.GetPosition(myMap);

          ESRI.ArcGIS.Client.Geometry.MapPoint mapPoint = myMap.ScreenToMap(screenPoint); 
          if (myMap.WrapAroundIsActive)
                    mapPoint = ESRI.ArcGIS.Client.Geometry.Geometry.NormalizeCentralMeridian(mapPoint) as ESRI.ArcGIS.Client.Geometry.MapPoint; 
          MapCoordsTextBlock.Text = string.Format("X = {0} , Y = {1}",
                Math.Round(mapPoint.X, 4), Math.Round(mapPoint.Y, 4));
      }
}

#endregion 

效果如下图:
ArcGIS API for Silverlight 鼠标移动显示地理坐标
上一篇:一个模型处理多种模态和任务,商汤等提出Uni-Perceiver,迈向通用预训练感知模型


下一篇:思科计划对物联网设备进行安全认证