Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How To Make Java Set A GPS On Google Maps With A Location 'A' And Location 'B'

I Want To Make Java Open Up Google Maps And Type In To Set A GPS Between Location A (Start) And Location B (Destination). I Also Want To Make An Option Where Location A Can Use Your Location As The Start.
Location A And B Will Be A Name Of A City Anywhere In The World ( In English )

I Tried Searching On The Internet About This But The Furthest I Got Was "How To Open A Website Using Java" And When That Worked I Had To Overide The Mouse And Keyboard And Then Type In To The Search….. And Much More Tedious Lines Of Code

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

A basic way of doing this would be to construct a Google Maps URL yourself, and then open that. The basic format for Google Maps directions is:

https://www.google.com/maps/dir/starting+address+separated+by+plus+signs/ending+location/

You can replace the starting and ending addresses with whatever you want. So for example, if you want to show directions from Albany, NY to Los Angeles, CA, you would use the following:

https://www.google.com/maps/dir/Albany+New+York/Los+Angeles+California/

Try opening that in your browser and you will see it shows directions from Albany to Los Angeles!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading