This document is archived and information here might be outdated.  Recommended version.

How to create and zoom to a bookmark in globe (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > ArcGIS extensions > 3D Analyst > Visualizing in 3D > Navigating in 3D > How to create and zoom to a bookmark in globe

How to create and zoom to a bookmark in globe

Bookmarks in 3D are saved camera perspectives. When using bookmarks, you can zoom to or revisit a location that is of importance.

In this topic

Creating and zooming to a bookmark in globe

To create bookmarks in globe, the IBookmark3D interface is used. Bookmarks are stored in ISceneBookmarks, which acts like a container.
To create and zoom to a bookmark in globe, perform the following steps:
  1. Get a handle to the bookmarks in the current scene as shown in the following code example:
ESRI.ArcGIS.GlobeCore.IGlobeDisplay globeDisplay=globe.GlobeDisplay;
ESRI.ArcGIS.Analyst3D.IScene scene=globeDisplay.Scene;
ESRI.ArcGIS.Analyst3D.ISceneBookmarks sceneBookmarks=
    (ESRI.ArcGIS.Analyst3D.ISceneBookmarks)scene; // Explicit cast.
Dim globeDisplay As ESRI.ArcGIS.GlobeCore.IGlobeDisplay=globe.GlobeDisplay
Dim scene As ESRI.ArcGIS.Analyst3D.IScene=globeDisplay.Scene
Dim sceneBookmarks As ESRI.ArcGIS.Analyst3D.ISceneBookmarks=CType(scene, ESRI.ArcGIS.Analyst3D.ISceneBookmarks) ' Explicit Cast
  1. Since 3D bookmarks are saved camera perspectives, get a handle to the camera of the active viewer as shown in the following code example. Other properties of the bookmark can also be set.
ESRI.ArcGIS.Analyst3D.ICamera camera=globeDisplay.ActiveViewer.Camera;
Dim camera As ESRI.ArcGIS.Analyst3D.ICamera=globeDisplay.ActiveViewer.Camera
  1. Use the current camera locations to create and capture bookmarks and add them to the scene. See the following code example:
ESRI.ArcGIS.Analyst3D.IBookmark3D bookmark=new ESRI.ArcGIS.Analyst3D.Bookmark3D();

bookmark.Name="Bookmark 1";

Dim bookmark As ESRI.ArcGIS.Analyst3D.IBookmark3D=Nothing

bookmark.Name="Bookmark 1"
  1. Get a handle to the scene bookmarks (ISceneBookmarks) as previously shown, and specify the bookmark to zoom to. The following code example shows how to find a bookmark in the current scene by name:
ESRI.ArcGIS.Analyst3D.IBookmark3D pBookmark;

sceneBookmarks.FindBookmark("Bookmark 1", out pBookmark);
Dim pBookmark As ESRI.ArcGIS.Analyst3D.IBookmark3D=Nothing

sceneBookmarks.FindBookmark("Bookmark 1", pBookmark)
  1. Zoom to the bookmark by applying the camera properties to the current active viewer as shown in the following code example:
pBookmark.Apply(globeDisplay.ActiveViewer, false, 0);
pBookmark.Apply(globeDisplay.ActiveViewer, False, 0)

Globe navigation modes

The two navigation modes in globe are surface navigation and globe navigation. If the bookmark you want to zoom to was saved in either mode, make sure that after zooming to the bookmark, you also set the navigation mode.

Surface navigation mode

In surface navigation mode, the camera is set at the surface and X, Y, Z have a nonzero value. If that is the case, set the navigation mode of the globe camera to surface navigation mode.

Globe navigation mode

In globe navigation mode, the camera target has (X, Y, Z) equal to (0, 0, 0). Query to see if the camera target is set to (0, 0, 0). If it is, set the navigation mode of the globe camera to globe navigation mode. After setting the navigation mode, refresh the active viewer. See the following code example:
ESRI.ArcGIS.Analyst3D.ICamera camera=globeDisplay.ActiveViewer.Camera;
ESRI.ArcGIS.GlobeCore.IGlobeCamera globeCamera=(IGlobeCamera)camera; 
    // Explicit cast.

double pXT, pYT, pZT;
camera.Target.QueryCoords(out pXT, out pYT);


globeCamera=(ESRI.ArcGIS.GlobeCore.IGlobeCamera)camera; // Explicit cast. 

if ((pXT * pXT + pYT * pYT + pZT * pZT) < 0.000000000001)
    globeCamera.OrientationMode =
    globeCamera.OrientationMode =

Dim camera As ESRI.ArcGIS.Analyst3D.ICamera=sceneViewer.Camera
Dim globeCamera As ESRI.ArcGIS.GlobeCore.IGlobeCamera=CType(camera, ESRI.ArcGIS.GlobeCore.IGlobeCamera) ' Explict Cast

Dim pXT As System.Double=0
Dim pYT As System.Double=0
camera.Target.QueryCoords(pXT, pYT)

Dim pZT As System.Double

If (pXT * pXT + pYT * pYT + pZT * pZT) < 0.000000000001 Then
End If


Development licensing Deployment licensing
Engine Developer Kit Engine: 3D Analyst
ArcGIS Desktop Basic: 3D Analyst ArcGIS Desktop Basic: 3D Analyst
ArcGIS Desktop Standard: 3D Analyst ArcGIS Desktop Standard: 3D Analyst
ArcGIS Desktop Advanced: 3D Analyst ArcGIS Desktop Advanced: 3D Analyst