Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
New Contributor
ngardner
Posts: 2
Registered: ‎06-16-2011
My Carrier: n/a

Google Maps JavaScript API v3 only works with touchscreen devices

I've developed a mobile site, but ran into an issue when trying to get it to work on BlackBerry. With devices that don't have a touch screen it is impossible to pan around on a map, and even click on markers on the map. Here is a simple test page:

http://code.google.com/apis/maps/documentation/javascript/examples/marker-animations.html

 

On devices that have a touch screen Torch 9800 - You are able to pan around and touch the marker to make it start bouncing. On devices without touch screen, you cannot pan, and you cannot click on the marker.

 

Basically, you cant use Google Maps JavaScript API aon BlackBerry devices that dont have a touch screen ;(

Please use plain text.
Developer
interfaSys
Posts: 794
Registered: ‎11-19-2009
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Google Maps JavaScript API v3 only works with touchscreen devices

You may be importing the API the wrong way.

What does your import look like?

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Please use plain text.
Contributor
peebee
Posts: 13
Registered: ‎09-23-2010

Re: Google Maps JavaScript API v3 only works with touchscreen devices

Hi interfaSys, can you elaborate a bit on the import statement?  I am running into the same issue.

 

Any ideas?  Here's the code:

 

<!DOCTYPE html>
<html>
    <head>
        <title>Appr</title>
        <meta name="viewport" content="width=device-width, 
            initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <!-- <link  rel="stylesheet" type="text/css" href="bbui.css"></link> -->
        <script type="text/javascript" src="jquerymin.js"></script>
        <script src="http://maps.googleapis.com/maps/api/js?sensor=true" type="text/javascript"></script>
    </head>
    <body style="margin:0;">
    <div id="map-canvas" style="height:240px; width: 100%;">
        <!-- map loads here... -->
    </div>
    <script type="text/javascript">
        var map = null;
        $(document).ready(function () {
            try {
                var mapOptions = {
                    zoom: 3,
                    center: new google.maps.LatLng(19.300855, -90.967152),
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                };
                map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
            } catch (ex) {
                alert(ex);
            }
        });
    </script>
    </body>
</html>

 

Please use plain text.
Developer
interfaSys
Posts: 794
Registered: ‎11-19-2009
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Google Maps JavaScript API v3 only works with touchscreen devices

I don't remember what I had in mind... but it's strange that it isn't working because Google Maps provides touch or non-touch controls, based on the browser, so maybe something is broken in their detection system or BB uses the same ID for both touch and non-touch device.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Please use plain text.