ztyqq8818

SetToZoomToExtents in  globe

Discussion created by ztyqq8818 on Mar 6, 2014
Latest reply on May 27, 2014 by ztyqq8818
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!

Outcomes