Answered Bing Maps v7 SDK KeyUp event listener

  • Wednesday, January 25, 2012 7:31 PM
     
     

    Firstly, does anybody in the dev team for bing maps frequent (or even visit) these forums? If not, where can I go to post an issue with the SDK?

    This is my problem:

    I have a bing map that is not always in view (due to some collapsible elements it's sometimes hidden). However, because embedding a bing map on my page assigned a keyup event listener to the document, no matter if the map is in view or not, it always 'moves' based on me pushing the arrow keys. 

    I've tested this and if the map is hidden and I push an arrow key, then when I expand the collapsible element that map view has changed due to it responding to the keyup event on the document.

    Yes, I've already come up with crappy partial workarounds - but this use-case describes an issue where you have to remove the keyup event from the document and instead put it on the map itself!!!

All Replies

  • Thursday, January 26, 2012 9:28 AM
    Owner
     
     Answered
    The dev team and other members of the Bing Maps team frequently go through these blogs. I'm not on the dev team but am on the Bing Maps team. Would you be able to provide sample code that reproduces this issue? If I'm able to reproduce the issue I'll pass it on to the dev team for investigation.
    http://rbrundritt.wordpress.com
  • Thursday, January 26, 2012 11:43 AM
     
     

    http://adamjenkins.s463.sureserver.com/example-code/bing/

     

    Click the "Hide Bing Map" link, then push an arrow key (it's easiest to notice if you push and hold an arrow in a single direction) for a second or two) and then click "Bing Map" - you'll notice the map is in a different position than when the map first loaded (or whatever position you had it in when you clicked "Hide Bing Map".

    While this behaviour isn't really what I would consider a bug, it is an edge-case that illustrates that it's poor practice to move the map via all keyup events, even if the map isn't visible.

    There might be a a 'work around' in the API itself where I can cancel bing map events myself if I know the map is hidden, but I'm not sure what it would be....