通过GlobeControl提供的接口对加载在GlobeControl上的矢量特征要素进行操作的代码如下:
IPoint ppPoint = new PointClass();
(ppPoint as IZAware).ZAware = true;
object ppObject;
object ppOwner;
axGlobeCtrl.GlobeDisplay.Locate(axGlobeCtrl.GlobeDisplay.ActiveViewer, e.x, e.y, false, false, out ppPoint, out ppOwner, out ppObject);
//如果为空返回
if (ppPoint == null || ppOwner == null)
return;
IElement element = ppObject as IElement; //element包含了选择的矢量要素
// IPoint point = element.Geometry as IPoint; //选择并标记矢量要素
IGlobeGraphicsLayer layer = ppOwner as IGlobeGraphicsLayer;
IGraphicsSelection graphicsSelection = layer as IGraphicsSelection;
graphicsSelection.SelectElement(element);
axGlobeCtrl.GlobeDisplay.
RefreshViewers();
引用地址:http://bbs.fovly.com/thread-43-1-1.html