ArcGIS Pro 屏幕上一点转换为地图上点
Posted gisoracle
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ArcGIS Pro 屏幕上一点转换为地图上点相关的知识,希望对你有一定的参考价值。
/* Copyright 2018 Esri Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ArcGIS.Desktop.Mapping; using ArcGIS.Desktop.Framework.Threading.Tasks; namespace Examples { internal class GetMapCoordinates : MapTool { protected override void OnToolMouseDown(MapViewMouseButtonEventArgs e) { if (e.ChangedButton == System.Windows.Input.MouseButton.Left) e.Handled = true; //Handle the event args to get the call to the corresponding async method } protected override Task HandleMouseDownAsync(MapViewMouseButtonEventArgs e) { return QueuedTask.Run(() => { //Convert the clicked point in client coordinates to the corresponding map coordinates. var mapPoint = MapView.Active.ClientToMap(e.ClientPoint); ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(string.Format("X: {0} Y: {1} Z: {2}", mapPoint.X, mapPoint.Y, mapPoint.Z), "Map Coordinates"); }); } } }
来自:https://github.com/Esri/arcgis-pro-sdk/blob/master/Examples/MapExploration/GetMapCoordinates.cs
以上是关于ArcGIS Pro 屏幕上一点转换为地图上点的主要内容,如果未能解决你的问题,请参考以下文章
ArcGIS Pro微课1000例0019:ArcGIS Pro从海洋的视角看世界---海洋投影(Spilhaus Projection)
ArcGIS Pro风暴ArcGIS Pro 2.5基于矢量数据制作拉伸三维地图案例