Trouble Zooming & changing Yaw at the same time

Oct 1, 2009 at 7:45 PM

I'm working with the map on a Windows 7 multitouch system and am trying to implement simultaneous zoom and rotation.  If found that either of these methods works in isolation:

Rotate: Map.Yaw += rotation

Zoom: Map.DoMapZoom(zoomValue, true);

However, if I try to do both at the same time the zoom function doesn't work.  I've also tried to modify the map's altitude instead of using DoMapZoom but it had no effect.  Interestingly, I found that when calling DoMapZoom I have to supply "true" for IsContinuous otherwise there's no effect.  Not sure why that is.  Any help is appreciated!

Oct 2, 2009 at 1:32 AM

When you set the Roll, Pitch, Yaw, Latitude, Longitude, or Altitude properties, the control eventually calls JumpTo(...), which creates a JumpCameraController and sets the next camera controller to that.

The JumpCameraController basically just changes the camera to move to the specified location in one frame.

DoMapMove() and DoMapZoom() both use the


to update the camera, which internally creates or modifies a camera controller.  When you call both functions within one frame, whichever method is called last prevails.

The DoMapMove() and DoMapZoom() are meant for moving the map in more automated ways, like through manipulation or inertia processors, which is what you are and should be doing.  The direct properties are meant for direct changes, such as when a user clicks a button to jump somwhere.  Mixing the two methods will cause the behavior you saw.

Take a look at that NavControl object and see if there is a Yaw variation.

Alternately, you could modify your code to use the RPY LLA properties, though you'd have to account for how much to change the lat/long based upon the altitude.

The isContinuous property is there because the NavControl is sticky.  If you need to call it only once, you could use isContinuous=false, and you should use larger parameter values.  If you use isContinuous=true, it will keep moving, and you can use smaller values.