pan issue on mobile device web control
-
domenica 17 luglio 2011 21:00
I'm using a bing map AJAX control within a web page hosted on a mobile device ( samsung bada ). The bing APIs to zoom in /out and set center work fine by issuing the relevant javascript commands. However the pan operation (moving map) around just doesn't work by using the drag/hold touch events. Even using the dashboard control, a continuous pan starts which can't be stopped on version 7.0. There appears to be a mismatch in the events generated by the device and how they are translated by the map control inside the web page.
I noticed in 6.3 there are apis available to do pan (map.pantolatlong(x,y), map.pan). With a bit of effort, the phone device touch events can be mapped into pan commands inside the web page to achieve this operation. I would like to know if there is any alternative simpler solution to this? Also are the pan and pantolatlong methods available in v7. If not, any equivalent methods ?
Tutte le risposte
-
lunedì 18 luglio 2011 02:09
This seems more like browser specific issue on your device. I think browser does not support touch supportfor maps. Try opening any other mapping related website.
The Nav bar is not optimized for mobile, you can create your known easily for mobile devices. There is way to set pan using setView described in below thread.
MSFT
Hemant Goyal- Contrassegnato come risposta Richard_BrundrittMicrosoft Employee, Moderator lunedì 18 luglio 2011 13:47
- Contrassegno come risposta annullato greenfieldsnow martedì 19 luglio 2011 01:29
-
lunedì 18 luglio 2011 18:15
Hemant,
Google maps works fine with pan movements using touch on the device. It turns out that pan can be done on bing 7.0 using the Nav bar which, as you have mentioned is not optimised so tricky to navigate properly. Pan using device touch in Bing does not work as expected.
The map initialisation code is very simple, here are snippets for both
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
function initialize() { var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, disableDefaultUI: true, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
and for bing its similarmap = new Microsoft.Maps.Map(document.getElementById("mapDiv"), {credentials: "", center: new Microsoft.Maps.Location(45.5, -122.5), mapTypeId: Microsoft.Maps.MapTypeId.road, disablePanning:false, showDashboard:true, // this value shows or hides the navigation dashboard zoom: 7});
The response from Samsung developer support is similar to my findings - that pan works fine in Google therefore it doesn't appear to be a browser issue. If there is some configuration to enable panning using touch events on Bing then I'd like to know what it is. Otherwise this issue appears to be in the Bing maps area.
-
giovedì 21 luglio 2011 19:42Any further information from Microsoft on this ?
-
venerdì 22 luglio 2011 05:07Could you tell the browser on the device? As far as I know, you might need to check documenation of device browser which provide some meta tags you can place on your place to enable touch support to that specific browser. Pan works as expected on andriod, iphone, WP7 devices.
MSFT
Hemant Goyal -
venerdì 22 luglio 2011 22:24
The browser on the wave device is dolphin. Samsung developer support confirm that the pan option in the browser is enabled by default. They don't think it is a problem at their end.
-
lunedì 25 luglio 2011 05:13I tried on Andriod device & dophin 6.0.0 version. I could not repro the issue, pan works fine along with zoom with double click. Could you try on their latest version?
MSFT
Hemant Goyal -
martedì 26 luglio 2011 17:37
Hemant,
The browser on the Samsung Bada phones I am using is Dolfin v2.2 which is different from "Dolphin" on Android you refer to. Both are webkit based though the latter has been developed by MoboTap while the former is Samsung's.
This issue is going back and forth between us, Microsoft and Samsung without any resolution. Can someone in the bing maps team just check on a Bada Wave phone whether the auto pan and auto zoom work inside the browser. Bada is gaining popularity in places like India, China and parts of Europe and we are developing this app for a customer who have specifically asked for Bing maps - we know that this issue does not exist with google maps and decarta on the Bada platform.
Kind regards
AZ

