How do I implement Zoomtolayer in Arcglobe (i to zoom to layer in globe)

Source: Internet
Author: User
zooming to a layer in globe

1.To Zoom to a layer into globe get a handle to the layer as shown code following. To get a handle to a specific layer, pass in the layer index.

Focus on a layer in the globe and get the handle to the layer as shown in the following code instance. A handle to a specific layer is obtained by passing the index of the layer.
[C #] ESRI. ArcGIS.Analyst3D.IScene scene = (ESRI. ArcGIS.Analyst3D.IScene) Globe; Explicit cast.
ESRI. ArcGIS.Carto.ILayer layer = Scene.get_layer (layerindex);

Of course, Ilayer does not have to be obtained by the index of the layer, or by the layer name.

2.Now, get the extent of the layer using the following code example:

Now use the following code instance to get the scope of the layer.
[C #] ESRI. ArcGIS.Geometry.IEnvelope envelope = layer. Areaofinterest.envelope;

3.After Getting the extent, the Iglobecamera.settozoomtoextents method can is used to zoom to the extent of the. See the following code example:     after getting the layer's range, the Iglobecamera.settozoomtoextents method can be used to focus on the range of the layer. Look at the following code instance.
[c#]  ESRI. arcgis.analyst3d.icamera camera = globedisplay.activeviewer.camera;
ESRI. arcgis.globecore.iglobecamera globecamera =  (ESRI. ArcGIS.GlobeCore.IGlobeCamera) Camera; // explicit cast.
ESRI. arcgis.analyst3d.isceneviewer sceneviewer = globedisplay.activeviewer;
Globecamera.settozoomtoextents (envelope, globe, sceneviewer); 
  above code is tested and fully available (nonsense, Is the help of easy water still wrong? ) ~ hehe ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.