In the latest release of the 3D map control some new properties were added that allow you to specify where the map should appear when loading. The benefit of this is that the map will load at a specific location where as before you had to load the map and see the whole globe then call the FlyTo method to fly to your location. The properties are called StartAltitude, StartPitch, StartHeading, StartLongitude, and StartLatitude. To set these properties you should use an event handler on the RenderEngine.Initialized event. For example:
this.globeControl.Host.RenderEngine.Initialized += new EventHandler(Initialized); |
Inside the method that gets called by the Initialized event the data sources, and the initial location information can be loaded:
private void Initialized(object sender, EventArgs e) // set various data sources, here for elevation data, terrain data, and model data. //Set the intial globe position // Using this event is the proper way to handle loading and activation. // Plug-ins can also be loaded by path to a dll, but this one is built-in se we reference by type. |
WinForm application that demonstrates how to do this has been uploaded here: http://cid-e7dba9a4bfd458c5.skydrive.live.com/self.aspx/VE%20Sample%20code/VE3DFlyToExample%7C_WinForm.zip