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.

inside custom component

Web and WebWorks Development

Reply
New Contributor
ANKUGARG9
Posts: 4
Registered: ‎07-10-2012
My Device: 9800
Accepted Solution

maps.google.com/maps not opening on Blackberry

We came across one issue on BlackBerry OS6 & OS7 that Google maps are not working as expected. As per current implementation, we are sending user to http://maps.google.com/maps

when user submits “Get Direction” button to show maps. Somehow, Blackberry OS6 is redirecting this URL to something different .

 

For example , If I am trying to open URL  http://maps.google.com/maps?hl=en&ie=UTF8&t=k&ll=40.52923,-79.820223&spn=0.014972,0.041499&z=15,

It is automatically getting redirected to http://maps.google.com/m/local?hl=en&ie=UTF8&ll=40.530176,-79.826746&spn=0.016244,0.046649&t=k&z=15 - i.e. the Mobile Local maps web service.

 

Please provide fix is possible.

 

Note: There are 2 type of views in blackberry when accessing google.com

1. Mobile view

2. Classic view

 Maps works fine on classic view but there is no way to set is as default view

Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: maps.google.com/maps not opening on Blackberry

This behavior is caused by Google's servers detecting the BlackBerry as a mobile device and delivering the targeted URL as a result.  Likely this is based on the user-agent header being send during the HTTP request for that resource.  Note: there is no way to override that UA value from the device.

 

Question: do you have to use Google Maps?  Have you considered any alternatives, such as:

http://devblog.blackberry.com/2012/05/lightweight-maps-for-mobile-part-1/

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
ANKUGARG9
Posts: 4
Registered: ‎07-10-2012
My Device: 9800

Re: maps.google.com/maps not opening on Blackberry

I can not change the implementaion as website is about to launch now!!!

 

I am able to find solution for it.

 

I passed parameter "ui=maps" and now google maps are opening well.

 

Thanks for your support.

 

-Ankur Garg 

Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: maps.google.com/maps not opening on Blackberry

Glad you found a solution.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
cissemy
Posts: 2
Registered: ‎06-09-2009
My Device: Not Specified

Re: maps.google.com/maps not opening on Blackberry

Hi,

I am having the same issue right .

I would like to know where you added  parameter "ui=maps" ?

In my code i am using : <script src="jquery.ui.map.min.js"></script>

and  $('#map_canvas_1').gmap({'center': getLatLng(), 'zoom': 16});

 

function getLatLng() {
     // GpsIt();
      var geocoder = new google.maps.Geocoder();
     // var latlng = new google.maps.LatLng(Lat, Lng);
      var latlng = new google.maps.LatLng(40.758195, -73.980878);
      geocoder.geocode({'latLng': latlng}, function(results, status) {
                     if (status == google.maps.GeocoderStatus.OK) {
                        if (results[0]){
                           $('#map_canvas_1').gmap('addMarker', {'position': latlng, 'title': 'Current Location'});
                           $("#from").val(results[0].formatted_address);
                        }
                        } else {
                           alert("Geocoder failed due to: " + status);
                           $('#map_canvas_1').gmap('addMarker', {'position': latlng, 'title': 'DDS Location'});
                     $("#from").val('64 West 48 St,New York,NY 10036');
                        }
                     });
      return latlng;
     }

 

Thanks,

 

New Contributor
ANKUGARG9
Posts: 4
Registered: ‎07-10-2012
My Device: 9800

Re: maps.google.com/maps not opening on Blackberry

I was trying to open maps.google.com/maps  Like Below URL

 

http://maps.google.com/maps?saddr=Piscataway%20Township,%20NJ%2008854,%20USA&daddr=1303%20CENTENIAL%...

 

Above URL was not opening in blackerry, it was getting rediercted to something which was not showing maps.

 

I added "ui=maps" to this URL.

 

I hope this helps

 

-Ankur