|
|
|
08-02-2008, 10:24 AM
|
#1
|
CrackBerry Addict
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
|
Here's how to start Google Maps with a landmark
Please Login to Remove!
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 10:26 AM..
|
Offline
|
|
08-02-2008, 02:55 PM
|
#2
|
Thumbs Must Hurt
Join Date: Mar 2008
Location: Columbia, MD
Model: 8130
PIN: N/A
Carrier: verizon
Posts: 95
|
Nice! I'll have to give it a shot.
|
Offline
|
|
08-02-2008, 04:53 PM
|
#3
|
BlackBerry Extraordinaire
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
|
Wirelessly posted (8820)
Thanks! Can't wait to try that out.
__________________
My other Blackberry is a PlayBook.
|
Offline
|
|
08-06-2008, 10:02 AM
|
#4
|
Talking BlackBerry Encyclopedia
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
|
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
|
Offline
|
|
08-06-2008, 10:18 AM
|
#5
|
CrackBerry Addict
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
|
I thought it was "action=LOCN&a=someaddress" but I haven't tried it.
|
Offline
|
|
08-11-2008, 07:19 AM
|
#6
|
Thumbs Must Hurt
Join Date: Mar 2008
Location: Columbia, MD
Model: 8130
PIN: N/A
Carrier: verizon
Posts: 95
|
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.
|
Offline
|
|
11-12-2008, 12:01 AM
|
#7
|
BlackBerry Extraordinaire
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
|
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.
|
Offline
|
|
11-12-2008, 12:19 PM
|
#8
|
CrackBerry Addict
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
|
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.
|
Offline
|
|
11-12-2008, 12:57 PM
|
#9
|
BlackBerry Extraordinaire
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
|
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?
|
Offline
|
|
11-12-2008, 01:43 PM
|
#10
|
BlackBerry Extraordinaire
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
|
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)
|
Offline
|
|
11-12-2008, 04:45 PM
|
#11
|
CrackBerry Addict
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
|
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.
|
Offline
|
|
11-12-2008, 05:01 PM
|
#12
|
CrackBerry Addict
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
|
Just downloaded 2.3.2 and am still not seeing the same problem as you are.
|
Offline
|
|
01-29-2009, 09:31 PM
|
#13
|
CrackBerry Addict
Join Date: Jun 2006
Location: Ontario, Canada
Model: 9000
OS: 4.6
Carrier: Rogers
Posts: 625
|
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
|
Offline
|
|
03-06-2009, 06:35 PM
|
#14
|
New Member
Join Date: Feb 2008
Model: 7730
PIN: N/A
Carrier: tmobile
Posts: 2
|
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
|
Offline
|
|
04-03-2009, 05:08 PM
|
#15
|
Knows Where the Search Button Is
Join Date: Feb 2008
Model: none
Carrier: sprint
Posts: 24
|
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
|
Offline
|
|
04-05-2009, 09:51 AM
|
#16
|
Knows Where the Search Button Is
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
|
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 09:52 AM..
|
Offline
|
|
04-05-2009, 03:07 PM
|
#17
|
New Member
Join Date: Apr 2009
Model: BOLD
PIN: N/A
Carrier: ATT
Posts: 1
|
It works. Thanks. Has anyone tried to plot multiple locations on the map? I blindedly tried different URL formats without any luck.
|
Offline
|
|
04-05-2009, 04:05 PM
|
#18
|
Knows Where the Search Button Is
Join Date: Feb 2008
Model: none
Carrier: sprint
Posts: 24
|
Quote:
Originally Posted by GasBot
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?
|
Offline
|
|
04-06-2009, 01:00 AM
|
#19
|
Knows Where the Search Button Is
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
|
Quote:
Originally Posted by lionscribe
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.
|
Offline
|
|
04-27-2009, 07:59 AM
|
#20
|
New Member
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: Project Trainee
Posts: 1
|
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 08:33 AM..
|
Offline
|
|
|
|