ArcGIS Pro地图范围和视野范围
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | atialReference sr3857 = SpatialReferenceBuilder.CreateSpatialReference(3857); // Builder constructors need to run on the MCT. using (SpatialReferenceBuilder srBuilder = new SpatialReferenceBuilder(3857)) { // do something with the builder sr3857 = srBuilder.ToSpatialReference(); } ArcGIS.Core.Geometry.Polygon envPoly = null ; Envelope mapExtent = (Envelope)GeometryEngine.Instance.Project(MapView.Active.Extent, sr3857); private Envelope BuildEnvelope(MapPoint mapPt, Envelope inputEnvelope) { EnvelopeBuilder envelopeBuilder = new EnvelopeBuilder(SpatialReferences.WebMercator); envelopeBuilder.XMin = inputEnvelope.XMin; envelopeBuilder.YMin = inputEnvelope.YMin; envelopeBuilder.XMax = inputEnvelope.XMax; envelopeBuilder.YMax = inputEnvelope.YMax; return envelopeBuilder.ToGeometry(); } Envelope mapExtent = BuildEnvelope(MapView.Active.Extent) Envelope mapExtent = EnvelopeBuilder.CreateEnvelope(MapView.Active.Extent, SpatialReferences.WebMercator); Envelope mapExtent = EnvelopeBuilder.CreateEnvelope(MapView.Active.Extent, SpatialReferences.WebMercator); |
Size mapSize = MapView.Active.GetViewSize();
MapPoint pt1 = MapView.Active.ClientToMap(new Point(0, 0));
MapPoint pt2 = MapView.Active.ClientToMap(new Point(mapSize.Width * scale, 0));
MapPoint pt3 = MapView.Active.ClientToMap(new Point(mapSize.Width * scale, mapSize.Height * scale));
MapPoint pt4 = MapView.Active.ClientToMap(new Point(0, mapSize.Height * scale));
Point mapClientPt = MapView.Active.MapToClient(screenMapPt);
bool ptIntersects = (mapClientPt.X >= 0) && (mapClientPt.Y >= 0) && (mapClientPt.X <= mapSize.Width * scale) && (mapClientPt.Y <= mapSize.Height * scale);
This produces the exact results that I am looking for. Once I have the rectangle I can then check to see if the mouse intersects it or not.
Thanks again to the Esri ArcGIS Pro SDK team.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
2019-05-13 Python可变参数函数用法详解
2019-05-13 ArcGIS Python 获得坐标
2011-05-13 arcgis tin内存溢出解决办法
2011-05-13 ArcGIS10 数据建模 每日一贴 花边图框制作
2011-05-13 ArcGIS10 三维成果展示