none
How can users adjust zoom on the Bing Maps AJAX control with touch gestures on iPhone and Android?

    Question

  • When viewing a Bing Maps AJAX controls on an iPhone or Android, it seems that the touch gestures - pinch in and out - do not allow zooming on the map control. 

    Is there a way to use touch gestures to adjust the zoom on a Bing Maps AJAX control, or do users have to click the +/- zoom buttons on the toolbar?

    Thanks,

    Scott

    Thursday, October 06, 2011 8:02 PM

Answers

  • Unfortunately, the Windows Phone 7 version of IE does not raise the necessary events for pinch zoom to work (either Mango or earlier versions).
    Monday, October 10, 2011 7:23 PM
  • In WP7 this can't be done as the browser itself only throws a single touch event. In old Android versions that didn't support multitouch it was possible to work around them by wrapping the the web browser control with a grid and adding multitouch to that and then using those events to inject javascript calls to the map via the web browser. It works ok and it might be possible to do something similar with WP7 but I haven't tried it. Take a look at the Bing Maps Android SDK on CodePlex to see how I did it there: http://bingmapsandroidsdk.codeplex.com/

    http://rbrundritt.wordpress.com

    Thursday, October 31, 2013 1:10 PM
    Owner

All replies

  • Pinch zoom should work fine on iOS browsers as long as you are using the latest V7 control. You may need a page level directive to prevent the iOS browser from scaling the page.

    Android browsers do not raise the necessary touch events for pinch zoom to work, unfortunately.

    Thursday, October 06, 2011 10:36 PM
  • What about Windows Phone 7, using the Mango update?

    I cannot get pinch-to-zoom to work inside IE under WP7 Mango with the v7 Ajax control. Nor does it work with a direct visit to bing.com/maps.

    Also, under Mango, the Interactive SDK gets a Javascript error (http://www.bingmapsportal.com/isdk/ajaxv7)

     

    (for what it's worth, I HAVE had success with pinch to zoom inside iOS devices using the Bing Ajax control. Kind of ironic that WP7 is having issues though)

    Monday, October 10, 2011 7:01 PM
  • Unfortunately, the Windows Phone 7 version of IE does not raise the necessary events for pinch zoom to work (either Mango or earlier versions).
    Monday, October 10, 2011 7:23 PM
  • Is there a time table for resolving this issue on Windows 8 and/or 8.1?
    Thursday, October 10, 2013 1:53 PM
  • WP7 only supports single touch in the browser, so pinch to zoom will not work in that case. I put together a code sample of a cross platform app using v7 which adds zoom buttons if pinch/multi touch is not supported. You can find the code sample here: http://code.msdn.microsoft.com/Cross-Platform-Bing-Maps-e96600d5

    http://rbrundritt.wordpress.com

    Friday, October 11, 2013 10:55 AM
    Owner
  • Would there be anyway to simulate the pinch zoom? Possible with a div over top of the map to capture the appropriate events? I have not been able to get the Bing Map control to play nicely with any other HTML elements. 
    Thursday, October 31, 2013 12:14 PM
  • In WP7 this can't be done as the browser itself only throws a single touch event. In old Android versions that didn't support multitouch it was possible to work around them by wrapping the the web browser control with a grid and adding multitouch to that and then using those events to inject javascript calls to the map via the web browser. It works ok and it might be possible to do something similar with WP7 but I haven't tried it. Take a look at the Bing Maps Android SDK on CodePlex to see how I did it there: http://bingmapsandroidsdk.codeplex.com/

    http://rbrundritt.wordpress.com

    Thursday, October 31, 2013 1:10 PM
    Owner