Monday, March 23, 2009

IGlobeCamera::SetToZoomToExtents

Being able to zoom from one point to another using ArcGlobe is a nice feature. However, in order to zoom around in an animated fashion you need to turn on this feature in ArcGlobe. To do so, just click Tools > Options and then click on the General tab and then check "Animate viewer when using tools and commands." You can also set the speed. But, if you're a developer you might need to set this programmatically. For example, if you've built a Desktop tool you don't want your end user to have to set this in order for the tool to work. Or, if you've built an Engine tool the Desktop software may not even be installed on the client machine. But, how? Unfortunately there doesn't seem to be a way to this via ArcObjects but you can set this via the registry in the following location:

HKEY_CURRENT_USER\Software\ESRI\ArcGlobe\Settings\AnimateTools

Just change the value from 0 to 1. Now, if you need to build a custom tool that zooms to a point, some selected features, or around an entire layer via IGlobeCamera::SetToZoomToExtents, this tool will now zoom in and out in an animated manner.

No comments:

Post a Comment