<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 鼠标移动显示地理坐标全部内容,希望文章能够帮你解决ArcGIS API for Silverlight 鼠标移动显示地理坐标所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)