Jun 2, 2009 at 3:08 PM

Nice work! A pity the Globecontrol needs to be hosted.

I have an application using 2D GIS for which I'm looking at the possibility of integrating 3D mapping. As the app is a WPF app I've been using InfoStrat.VE. The app makes extensive use of geocoding and navigation to places which are at various altitudes. So here's my problem.

The ve geocoding service does not return altitude, so I cannot set it when calling flyto(). If i don't set altitude in the call, the mapcontrol's altitude remains the same which causes a problem going from a low place to a high place. If instead I pass altitude = 0, the map control seems to stop at the real altitude, but my zoom level is way to high.

To solve the problem, is there any way I can obtain the place's altitude before calling FlyTo(). Or maybe I can use the BestView returned by the geocoding service?

Maybe I don't quite understand the relation between Zoom and altitude.

Any suggestions,




Jun 2, 2009 at 4:35 PM

As usual, a little more trying and I found a work-around. I consider the altitude passed to FlyTo() as relative or AGL and added this in veMap.FlyTo:


lla = latLong.ToLatLonAlt();<font size="2">




double surfaceElevation = this.globeControl.Host.WorldEngine.GetSurfaceElevation(lla.LatLon);

lla.Altitude = surfaceElevation + altitude;

<font size="2">




this.globeControl.Host.Navigation.FlyTo(lla, pitch, yaw, false, cam);

It works, but not entierly satisfactory as it will not work after I download your next version.  I suppose I could do the same in my code before calling veMap.FlyTo()...

Jun 2, 2009 at 5:39 PM

Yeah, you don't need to modify the control's code for that.  You can just add it to your own code somewhere.

I'll consider adding a FlyToAGL and a support function for getting the elevation in the future.

Regarding zoom vs. altitude, just use altitude.  There are some functions in there for setting zoom levels, but those are just because VE has them as well.  You can get along just find by ignoring the zoom level and only setting/getting altitude.