none
Ctrl-Left Click zoom functionality has interesting behavior RRS feed

  • General discussion

  • While poking around at http://www.microsoft.com/maps/isdk/silverlight/ I noticed some interesting Ctrl-Left Click zoom behavior.  I haven't been able to locate any previous reports of this behavior in the forums, so I'm posting this.  Note that I am not a Silverlight developer, nor am I personally looking for a solution to this problem, but there may be others who are interested in a solution to the problem if anyone comes up with a clean one.

    One of the "shortcuts" in the Silverlight Bing Maps Control is the ability to hold down the Ctrl key and use the left mouse button to click and drag a highlighted selection box and when the mouse button is released the map control will zoom to that selection box.  If you do this and define the selection box from the upper-left to the lower-right or from the lower-left to the upper-right, everything works as expected.  However, if you do this from the upper-right to the lower-left or from the lower-right to the upper-left, it zooms all the way out to the entire globe.  This latter behavior is suspicious and probably undesireable.

    I suspect it's related to the code that enables the globe to display as an infinite sheet in the East/West direction.  I further suspect that the MouseMoveHandler code properly swaps left and right when the selection box is being defined in the "backwards" direction (I took a look at the code at http://www.garzilla.net/vemaps/SelectionBox.aspx to get some idea of how the underlying functionality may be handled), otherwise the selection box would extend off the left side of the screen and then loop back to the right side while it is being drawn.  So I suspect someone got it right when coding the MouseMoveHandler, but used different logic in the MouseUpHandler.  But this is all speculation.

    Still, I'm guessing that it wouldn't be too hard for someone to write some simple code to fix this without requiring an update to the underlying Silverlight Bing Map Control (although it still would be nice to fix it there eventually).

    • Changed type Ricky_Brundritt Friday, November 18, 2011 11:10 AM
    • Moved by Ricky_Brundritt Saturday, March 10, 2012 12:00 PM (From:Bing Maps: Map Control and Web services Development)
    Monday, November 14, 2011 9:34 PM