Select to view content in your preferred language

SetToZoomToExtents in  globe

2034
2
03-06-2014 04:39 PM
tianyuzhang
Emerging Contributor
Hi??guys

I???m new in GIS??and i'm developing a desktop app with a location function.
here is my code:
            
            DateTime startTime = DateTime.Now;
            IDisplay3D pDisplay = axGlobeControl1.GlobeDisplay as IDisplay3D;
            ESRI.ArcGIS.GlobeCore.IGlobe pGlobe = axGlobeControl1.Globe;
            ESRI.ArcGIS.GlobeCore.IGlobeDisplay pGlobeDisplay = pGlobe.GlobeDisplay;
            ESRI.ArcGIS.Analyst3D.ISceneViewer pSceneViewer = pGlobeDisplay.ActiveViewer;
            ESRI.ArcGIS.Analyst3D.ICamera pCamera = pSceneViewer.Camera;
            ESRI.ArcGIS.GlobeCore.IGlobeCamera pGlobeCamera = (ESRI.ArcGIS.GlobeCore.IGlobeCamera)pCamera;  

  
            IPoint centerPoint = new ESRI.ArcGIS.Geometry.Point();
            centerPoint.PutCoords(119.81, 37.23);

            IEnvelope envelope = new EnvelopeClass();

            envelope.XMin = centerPoint.X - 10;
            envelope.XMax = centerPoint.X + 10;
            envelope.YMin = centerPoint.Y - 10;
            envelope.YMax = centerPoint.Y + 10;
            //envelope.ZMin = centerPoint.Z - 10;
            //envelope.ZMax = centerPoint.Z + 10;
          

            pGlobeCamera.SetToZoomToExtents(envelope, pGlobe, pSceneViewer);         
            //pDisplay.FlashLocation(centerPoint);
            //Add3DSymbol();

            DateTime endTime = DateTime.Now;
            TimeSpan timeused = endTime - startTime;

this is the layer I loaded:
[ATTACH=CONFIG]31999[/ATTACH]

This code  worked ,but slowly ,especialy when i put a new pointcoordinates.Even 30s used!!

My english is worse ,I will appreciate very much if you could help me!
Thanks again!
0 Kudos
2 Replies
ErinBrimhall
Deactivated User
Hi Tianyu,

I may not be understanding your question correctly, but it sounds like it takes too long for the globe view to move between locations when you set the extent?

You might be looking for the AnimationTime property off the IAGAnimationContainer interface:

ESRI.ArcGIS.GlobeCore.IGlobe pGlobe = axGlobeControl1.Globe;
ESRI.ArcGIS.Animation.IAGAnimationContainer animationContainer = pGlobe as ESRI.ArcGIS.Animation.IAGAnimationContainer;

// Values range from 1 to 10.  1 = "fast", 10 = "slow"
IStringArray stringArray = new StrArrayClass();
stringArray.Add("1");

animationContainer.AnimationTime = stringArray;
0 Kudos
tianyuzhang
Emerging Contributor
Hi Tianyu,

I may not be understanding your question correctly, but it sounds like it takes too long for the globe view to move between locations when you set the extent?

You might be looking for the AnimationTime property off the IAGAnimationContainer interface:

ESRI.ArcGIS.GlobeCore.IGlobe pGlobe = axGlobeControl1.Globe;
ESRI.ArcGIS.Animation.IAGAnimationContainer animationContainer = pGlobe as ESRI.ArcGIS.Animation.IAGAnimationContainer;

// Values range from 1 to 10.  1 = "fast", 10 = "slow"
IStringArray stringArray = new StrArrayClass();
stringArray.Add("1");

animationContainer.AnimationTime = stringArray;


thank you for your answer!sorry about my reply!i'm sorry very much !!!
0 Kudos