HitTestMap 方法

个人笔记,个人理解,仅供参考

IActiveView.HitTestMap Method

Returns any maps present in the view at the given location. Return value may be zero if there are no maps or the coordinate is not over a map.

返回显示在视图(View)中指定位置的地图(Map)。如果没有地图(maps)或者指定的位置不在地图上,返回值为0.

[C#]

public IMap HitTestMap (

    IPoint Location

);

Use this method on a PageLayout to find the nearest Map based on a point location.  For example, when ArcMap's identify tool is used in Layout view, the tool first finds the Map clicked on before it searches for features in the Map.

在视图中使用此方法根据指定的点寻找最近的地图。例如,当在布局视图中使用ArcMap identify工具,该工具首先找到点击位置的Map对象,然后在Map对象中搜索要素。

When using this method on a PageLayout, for the Location parameter, set up the Point in page coordinates. To convert from device coordinates to page coordinates:

当在pageLayout中使用该方法时,指定点须设置在视图坐标系中。将屏幕坐标转换为page坐标:

1.Get the ScreenDisplay from the PageLayout using IActiveView::ScreenDisplay.

2.Get the DisplayTransformation from the ScreenDisplay usingIScreenDisplay::DisplayTransformation.

3.Convert device coordinates (for example from a mouse move) to page coordinates usingIDisplayTransformation::ToMapPoint.

Use this method on a Map to obtain a reference to it through IMap.

 

你可能感兴趣的:(test)