Google Driving Directions - MapView overlayed

Tutorials that use the MapActivity. Many using GPS functionality.

Postby jdoubleu » Tue Mar 25, 2008 5:53 pm

inter wrote:Thank minus for reply quickly

When i debug the program above .I see that the method draw is called first when the program launch .But when i click the button "Show me the route " i think it will call the method draw ,but it doesn't call .Why that . how to call the method draw when i click the button "Show me the route"

i copied 1-1 your program ,but it's not work .

help me

thanks

regard


I had a similar problem and plusminus suggested i make this call

myMapView.invalidate();

to force the map to redraw. I haven't had time to try it out yet, but give it a try and let us know if it fixed your issue.

-jw
jdoubleu
Freshman
Freshman
 
Posts: 3
Joined: Sat Mar 01, 2008 11:30 pm
Location: New York City

Top

Postby gustavo » Fri Mar 28, 2008 7:25 pm

Hi!

I have a silly doubt, how to convert the strings coordinates: 37.423157,-122.085008 to int: 37423157, -122085008
like you did on the code above?

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         /* Submit one dummy search */
  2.  
  3.           findViewById(R.id.cmd_submit).setOnClickListener(new OnClickListener(){
  4.  
  5.                @Override
  6.  
  7.                public void onClick(View arg0) {
  8.  
  9.                     MapPoint mpFrom = new MapPoint(37423157, -122085008); // 37.423157,-122.085008
  10.  
  11.                     MapPoint mpTo = new MapPoint(37495999, -122457508); // 37.495999,-122.457508
  12.  
  13.                     MyDrivingDirectionsActivity.this.startFetchDirections(mpFrom,"", mpTo, "");
  14.  
  15.                }
  16.  
  17.           });
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


Thx in advance.
Gustavo Ávila
VirtualSite
gustavo
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Mar 02, 2008 2:55 pm

after struggling whole night I did something new

Postby rahul_mawkins » Sat Mar 29, 2008 6:36 pm

following this application I found that if start and end are way too far the current zoom level dont allow two pins and route to be shown in map

I found a way how to dynamically adjust the zoom level so that whatever two destinations you add you can still see the two pins on map
for e.g
NJ to MA is hardly 215 miles
NJ to IL is 785miles
MA to CA is 3000 miles

But the zoom level which is calculated dynamically according to latitude/longitude and points on map shows it

Dont know if my ignorence allowed me to waste whole night or some of us are facing this problem also

If you are in same boat do let me know I will paste the code here
rahul_mawkins
Developer
Developer
 
Posts: 34
Joined: Wed Feb 27, 2008 4:09 am

Postby plusminus » Sat Mar 29, 2008 6:49 pm

Hello gustavo,

gustavo wrote:I have a silly doubt, how to convert the strings coordinates: 37.423157,-122.085008 to int: 37423157, -122085008
like you did on the code above?

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         /* Submit one dummy search */
  2.           findViewById(R.id.cmd_submit).setOnClickListener(new OnClickListener(){
  3.                @Override
  4.                public void onClick(View arg0) {
  5.                     MapPoint mpFrom = new MapPoint(37423157, -122085008); // 37.423157,-122.085008
  6.                     MapPoint mpTo = new MapPoint(37495999, -122457508); // 37.495999,-122.457508
  7.                     MyDrivingDirectionsActivity.this.startFetchDirections(mpFrom,"", mpTo, "");
  8.                }
  9.           });
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


You mean using code ?
Something like :darrow: should work:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. double d = Double.parseDouble("37.423157") * 1E6;
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby inter » Mon Mar 31, 2008 4:57 am

Hello ,plusminus

You are very "pro" in Android .I want to get coordinate (lattitude,longtitude) on Map when i click a point on a map
screen . I aslo have question silly .Map Activity used "rmi" technology ??? And i don't understand this code

this.getDispatcher().addDataRequest(this.myDD);

Please help me
thanks
regard
inter
Junior Developer
Junior Developer
 
Posts: 23
Joined: Thu Feb 21, 2008 10:13 am

Postby Kastagire » Wed Apr 30, 2008 11:15 pm

I went through this tutorial, but I am unable to get the map to show up. The emulator just shows a grid with a circle in the middle, and then the button from the layout. Pardon my ignorance, but I am new to both JAVA and Android. It looks like I would need to DL a maptile from Google, but I am not sure how to go about doing that.

any help is appreciated!

Thanks!
Kastagire
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Apr 29, 2008 8:47 pm

Top

Postby cadlg » Wed Apr 30, 2008 11:33 pm

Are you behind a proxy ?
cadlg
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Wed Feb 20, 2008 12:33 am
Location: Guatemala

Postby Kastagire » Thu May 01, 2008 1:24 pm

Yes most likely..... if that is the case, if I were not behind a proxy, would it go and get the map tile automatically?
Kastagire
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Apr 29, 2008 8:47 pm

Postby plusminus » Thu May 01, 2008 2:32 pm

Kastagire wrote:Yes most likely..... if that is the case, if I were not behind a proxy, would it go and get the map tile automatically?


Exactly.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Kastagire » Thu May 01, 2008 2:34 pm

awesome! Thanks +/-!
Kastagire
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Apr 29, 2008 8:47 pm

regognizing crossing two roads

Postby cbraun75 » Wed May 07, 2008 5:11 pm

Hi just one question,

google has a driving direction.
Has anybody an idea if I can regognize (I travel on a road from point a to b) the next incoming roads or one road that crosses this road. Because I need this to get roadsections to save data to this road sections which i get from the gps and the CAN -bus of a car. Or has anybody another idea to devide the driven road in sections. But it must be always the same section length for all users?

Maybe someone has an idea?

Thanxx

Christian
cbraun75
Junior Developer
Junior Developer
 
Posts: 23
Joined: Mon Jan 28, 2008 9:12 pm
Location: Munich

Re: regognizing crossing two roads

Postby plusminus » Wed May 07, 2008 7:46 pm

cbraun75 wrote:Hi just one question,

google has a driving direction.
Has anybody an idea if I can regognize (I travel on a road from point a to b) the next incoming roads or one road that crosses this road. Because I need this to get roadsections to save data to this road sections which i get from the gps and the CAN -bus of a car. Or has anybody another idea to devide the driven road in sections. But it must be always the same section length for all users?

Maybe someone has an idea?

Thanxx

Christian


Hello Christian,

imo this is really really hard (probably impossible if you want the results to be satisfying) to do this just with GoogleMaps, as one does not have access to the underlying mapdata.

But there is a route service (imo they had xml-reponse to requests) to get nearby streets, what could be a tiny point to start with. But unfortunately I forgot the name of that service :(

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby mana » Wed Jun 11, 2008 4:10 pm

Hi All,
is it possible to start the Overlay class with an Intent ? That you only send the coord. (x,y) with the Intent and then you draw the PINs and so on ?
Is that possible ?
Thanks.
mana
Freshman
Freshman
 
Posts: 6
Joined: Sat May 10, 2008 9:56 pm

Postby plusminus » Thu Jun 12, 2008 1:40 pm

Yes it is.
Look in the apidocs for registerReceiver, so you can handle intents directly within your activity.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Flamaker » Fri Aug 15, 2008 6:04 am

Hi plusminus

Thanks for this app, it's a really great intro to Android

One quick question.

How would I go about changing this app to move the "show me the directions" button to another activity? so that when the app starts all that I see is the button, upon pressing it I'm taken to another activity with the map in it only. So this is really separating one activity into two. I can't imagine it being too difficult but I cannot get it to work no matter what.

Could you please advise?

Thank you

Michal
Flamaker
Freshman
Freshman
 
Posts: 4
Joined: Fri Jul 25, 2008 1:28 am
Location: Adelaide

Top
PreviousNext

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests