BlackBerryForums.com : Your Number One BlackBerry Community
     

»Sponsored Links


BlackBerryApps.com Best Sellers



Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
RemyJ Offline
CrackBerry Addict
 
Posts: 671
Join Date: May 2005
Location: Golden, CO US
Model: 9630
Carrier: VZW
Default Here's how to start Google Maps with a landmark - 08-02-2008, 11:24 AM

Just FYI...

Basically, you start GoogleMaps with a URL like so...
Code:
http://gmm/x?action=LOCN&a=@latlon:35.0000,-105,0000&title=something&description=something
Code:
int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
if (mh == 0) {
     throw new ApplicationManagerException("GoogleMaps isn't installed");
}
URLEncodedPostData uepd = new URLEncodedPostData(null, false);
uepd.append("action","LOCN");
uepd.append("a", "@latlon:"+l.getLatitude()+","+l.getLongitude());
uepd.append("title", l.getName());
uepd.append("description", l.getDescription());
String[] args = { "http://gmm/x?"+uepd.toString() };
ApplicationDescriptor ad = CodeModuleManager.getApplicationDescriptors(mh)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args);
ApplicationManager.getApplicationManager().runApplication(ad2, true);
There are other actions and other ways to specify location but I'm still sifting through them.

Last edited by RemyJ : 08-02-2008 at 11:26 AM.
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
skicson Offline
Thumbs Must Hurt
 
Posts: 95
Join Date: Mar 2008
Location: Columbia, MD
Model: 8130
PIN: N/A
Carrier: verizon
Default 08-02-2008, 03:55 PM

Nice! I'll have to give it a shot.
   
Reply With Quote
  (#3 (permalink)) Old
hrbuckley Offline
CrackBerry Addict
 
Posts: 831
Join Date: Jan 2006
Model: 9000
OS: 4.6.0.303
Carrier: Rogers CA
Default 08-02-2008, 05:53 PM

Wirelessly posted (8820)

Thanks! Can't wait to try that out.


BPS/Zarafa
   
Reply With Quote
  (#4 (permalink)) Old
bemshaswing Offline
Talking BlackBerry Encyclopedia
 
Posts: 259
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Default 08-06-2008, 11:02 AM

RemyJ,
That's very helpful thanks. Do you know the parameters to use actual addresses instead of lat/long? They don't seem to be the same as the webapp, and I can't find much more on the mobile maps api
   
Reply With Quote
  (#5 (permalink)) Old
RemyJ Offline
CrackBerry Addict
 
Posts: 671
Join Date: May 2005
Location: Golden, CO US
Model: 9630
Carrier: VZW
Default 08-06-2008, 11:18 AM

I thought it was "action=LOCN&a=someaddress" but I haven't tried it.
   
Reply With Quote
  (#6 (permalink)) Old
skicson Offline
Thumbs Must Hurt
 
Posts: 95
Join Date: Mar 2008
Location: Columbia, MD
Model: 8130
PIN: N/A
Carrier: verizon
Default 08-11-2008, 08:19 AM

FYI - There is a problem if you attempt this with an older version of Google Maps (I was using 2.0.3). It caused my 8130 to lock up and I had to do a battery pull to get it back. The log showed an ArrayIndexOutOfBounds exception in Google Maps. Upgrading to the latest Google Maps (2.2) works fine tho.
   
Reply With Quote
  (#7 (permalink)) Old
Dougsg38p Offline
CrackBerry Addict
 
Posts: 815
Join Date: Mar 2008
Location: Austin, TX
Model: 8320
PIN: N/A
Carrier: T-Mobile
Default 11-12-2008, 12:01 AM

Anybody know where this info came from? I searched the web for hours and can find no references to this data, other than this thread.

This appears to be a one-shot deal, since the GoogleMaps application remains running when the user presses "escape" to exit the application. Subsequent calls to the above code result in a "foreground" request to the running application, which displays the last map only and ignores any command-line parameters. In order to display a 2nd location, the user would have to select "Exit" from the menu, which actually ends the maps application.

Has anyone had any success with Google Maps? I'm looking for a BB Maps replacement for AT&T phones.
   
Reply With Quote
  (#8 (permalink)) Old
RemyJ Offline
CrackBerry Addict
 
Posts: 671
Join Date: May 2005
Location: Golden, CO US
Model: 9630
Carrier: VZW
Default 11-12-2008, 12:19 PM

It's working correctly for me. If I use the escape key and then start the GM with a new landmark, it clears the last landmark and displays the new one.

This is Google maps 2.2.3 on a Sprint 8830, and 2.2.0 on an AT&T 8820.
   
Reply With Quote
  (#9 (permalink)) Old
Dougsg38p Offline
CrackBerry Addict
 
Posts: 815
Join Date: Mar 2008
Location: Austin, TX
Model: 8320
PIN: N/A
Carrier: T-Mobile
Default 11-12-2008, 12:57 PM

I'm running Google Maps 2.3.2 on a TMO 8320, 4.2.1.180.

Care to divulge the source of your original parameter info?
   
Reply With Quote
  (#10 (permalink)) Old
Dougsg38p Offline
CrackBerry Addict
 
Posts: 815
Join Date: Mar 2008
Location: Austin, TX
Model: 8320
PIN: N/A
Carrier: T-Mobile
Default 11-12-2008, 01:43 PM

On further testing, it looks like Google Maps will never "invoke" to the same location.

Example:
1. launch maps to location A - works OK
2. Launch maps to location B - works OK
3. Launch maps to location A again, this fails (maps remains on location B)

Another example:
1. Launch maps to location A
2. Move the map display to another location
3. Launch maps to Location A again, this fails (maps remains focused where you left it)
   
Reply With Quote
  (#11 (permalink)) Old
RemyJ Offline
CrackBerry Addict
 
Posts: 671
Join Date: May 2005
Location: Golden, CO US
Model: 9630
Carrier: VZW
Default 11-12-2008, 04:45 PM

I tried both your scenarios and they worked as expected. I'm not sure what to tell you. Maybe GM 2.3.2 has a bug or they changed the invocation string.

I got the info with some google searches. Honestly, I don't remember how.
   
Reply With Quote
  (#12 (permalink)) Old
RemyJ Offline
CrackBerry Addict
 
Posts: 671
Join Date: May 2005
Location: Golden, CO US
Model: 9630
Carrier: VZW
Default 11-12-2008, 05:01 PM

Just downloaded 2.3.2 and am still not seeing the same problem as you are.
   
Reply With Quote
  (#13 (permalink)) Old
ashworth Offline
CrackBerry Addict
 
ashworth's Avatar
 
Posts: 626
Join Date: Jun 2006
Location: Ontario, Canada
Model: 9000
OS: 4.6
Carrier: Rogers
Smile 01-29-2009, 09:31 PM

Do we know if we can add more then GPS location?

Also do we know if we can force the Zoom level, and Satellite view?

If we could that would be GREAT?

I will start Googling and see if I can find anything. If I do I will post it here.

I would like to try to get this working for my GPS Golf Application. I got the single point to work in testing with this but it would be nice to plot all of my GPS points for a single hole on the satellite view.

Thanks,
Ash
   
Reply With Quote
  (#14 (permalink)) Old
mpateck Offline
New Member
 
Posts: 2
Join Date: Feb 2008
Model: 7730
PIN: N/A
Carrier: tmobile
Default 03-06-2009, 06:35 PM

Hey there!

Has anyone found out a little bit more in the meanwhile?
I can use the LOCN sample very good, without any problems. No i wanna start a route, but the parameters from the url or from the mapki wiki site doesnt work...
Replacing the LOCN with ROUT will open the route dialog, but the saddr and daddr seems to be not supported.
A shame for google to not getting a api documentation for mobile apps online...

Bye,
Matthias
   
Reply With Quote
  (#15 (permalink)) Old
lionscribe Offline
Knows Where the Search Button Is
 
Posts: 24
Join Date: Feb 2008
Model: none
Carrier: sprint
Default 04-03-2009, 06:08 PM

Wirelessly posted

Thanks, it works.... but I am having a problem that sometimes the ZOOM is terrible, it shows the address on the map of the whole USA. Is there a way to specify the zoom in the parameters?
Lionscribe
   
Reply With Quote
  (#16 (permalink)) Old
GasBot Offline
Knows Where the Search Button Is
 
Posts: 22
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Default 04-05-2009, 10:51 AM

Have you tried adding a zoom element with an integer from 1 to 23 in there? Like this

uepd.append("zoom", "10");

I'm trying to use this snippet as well and I'm getting this error:

unreported exception net.rim.device.api.system.ApplicationManagerExcept ion; must be caught or declared to be thrown
ApplicationManager.getApplicationManager().runAppl ication(ad2, true);

Am I missing something here? I copied everything exactly how it was in the beginning of the thread.

EDIT: I just wrapped it in a try catch block and that error went away. Weird.

Last edited by GasBot : 04-05-2009 at 10:52 AM.
   
Reply With Quote
  (#17 (permalink)) Old
marialiu Offline
New Member
 
Posts: 1
Join Date: Apr 2009
Model: BOLD
PIN: N/A
Carrier: ATT
Default 04-05-2009, 04:07 PM

It works. Thanks. Has anyone tried to plot multiple locations on the map? I blindedly tried different URL formats without any luck.
   
Reply With Quote
  (#18 (permalink)) Old
lionscribe Offline
Knows Where the Search Button Is
 
Posts: 24
Join Date: Feb 2008
Model: none
Carrier: sprint
Default 04-05-2009, 05:05 PM

Quote:
Originally Posted by GasBot View Post
I just wrapped it in a try catch block and that error went away. Weird.
No, not weird. Obviously you are coming over from C++. In Java any method that declares itself that it throws an Exception, then the calling function has to catch it or pass it on. Otherwise you will get a compile error.

Did you ever get the zoom problem I mentioned?
   
Reply With Quote
  (#19 (permalink)) Old
GasBot Offline
Knows Where the Search Button Is
 
Posts: 22
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Default 04-06-2009, 02:00 AM

Quote:
Originally Posted by lionscribe View Post
No, not weird. Obviously you are coming over from C++. In Java any method that declares itself that it throws an Exception, then the calling function has to catch it or pass it on. Otherwise you will get a compile error.

Did you ever get the zoom problem I mentioned?
Nope, I haven't tried it yet though so I'm sure once I get there, I'll probably have the same problem.
   
Reply With Quote
  (#20 (permalink)) Old
vaikunth Offline
New Member
 
Posts: 1
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: Project Trainee
Default 04-27-2009, 08:59 AM

Hi to all

can i plot multiple points on google maps?
For single location it is working fine.

Thanks
Vaikunth

Last edited by vaikunth : 04-27-2009 at 09:33 AM.
   
Reply With Quote
  (#21 (permalink)) Old
knight9 Offline
New Member
 
Posts: 3
Join Date: Sep 2008
Model: 8310
PIN: N/A
Carrier: ATT
Default 07-04-2009, 03:16 AM

Anyone figure out how to set the zoom level? It seems to be always the previous zoom level the user had used.. I would be nice to provide a consistent zoom level when launching.
   
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright © 2004-2009 BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.