Results 1 to 6 of 6
  1. #1
    bruno.ufpe is offline Member
    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0

    Default Obtaining the distance between two points using GMaps

    Guys,

    I am creating a desktop app that requires the distance between two points using the Google API. I Already have inserted a web browser in my project and the user can point to the locations of the points. My question is: How can I get the distance information of the website from my application?

    Another question is: Do I have to set up a dedicated server to act as webserver and generate customized google map pages or I can do it just using the google maps standard page?

    Thank you
    Last edited by bruno.ufpe; 10-09-2013 at 10:49 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Obtaining the distance between two points using GMaps

    How can I get the distance information of the website from my application?
    Is the distance information available on the website? Can your program issue an HTTP GET to the website to get an html page with the info?

    Or is the info in the desktop app on the PC and you need to pass it to the website?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    bruno.ufpe is offline Member
    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0

    Default Re: Obtaining the distance between two points using GMaps

    Quote Originally Posted by Norm View Post
    Is the distance information available on the website? Can your program issue an HTTP GET to the website to get an html page with the info?

    Or is the info in the desktop app on the PC and you need to pass it to the website?
    My program is a desktop Java app that receives two user inputs (City name 1 and 2) and it must present on a internal SWT browser the cities on a google map page.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Obtaining the distance between two points using GMaps

    I still don't understand how the programs are supposed to work. Is it something like this:
    Somehow how the app on the PC gets the names of two cities (on an html page from a server). It then computes the distance between those cities (direct line or via some roads) and passes that info to a web sever. The web server can then use that info in an html page when that page is requested by a browser.

    What java packages and classes does the java program on the PC have?
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    bruno.ufpe is offline Member
    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0

    Default Re: Obtaining the distance between two points using GMaps

    Quote Originally Posted by Norm View Post
    I still don't understand how the programs are supposed to work. Is it something like this:
    Somehow how the app on the PC gets the names of two cities (on an html page from a server). It then computes the distance between those cities (direct line or via some roads) and passes that info to a web sever. The web server can then use that info in an html page when that page is requested by a browser.

    What java packages and classes does the java program on the PC have?
    The user provides the name of the two cities names using two textfields in the Java app. Then, the java application should start the browser showing in the map the two cities and the distance between them (straight line) [The distance between the cities must be provided by GMaps]. The java app must somehow be able to read the distance between them. In short, the user must provide the city names and the GMaps should give to Java app the distance and position of those cities.

    Tks

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Obtaining the distance between two points using GMaps

    Do you have the API doc for how to use GMaps? I've never used it.

    If the java program gets the data (city names), does the java program build a URL with that data and pass it to a browser which will use the URL to connect to the GMaps site and display the page returned. If all the GMaps data is displayed by the browser in the html page returned by GMaps, I don't know an easy way to get any of the data displayed by the browser into a java program.
    Last edited by Norm; 10-11-2013 at 04:47 PM.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Distance Between Two Points
    By HSKrustofsky in forum New To Java
    Replies: 6
    Last Post: 09-08-2011, 06:23 AM
  2. Replies: 1
    Last Post: 08-11-2011, 10:46 AM
  3. Obtaining File System in Use
    By ebm1991 in forum New To Java
    Replies: 1
    Last Post: 06-10-2011, 04:59 PM
  4. Calculating the distance between two points problem
    By silverglade in forum New To Java
    Replies: 16
    Last Post: 05-14-2011, 08:23 PM
  5. Replies: 2
    Last Post: 08-24-2008, 12:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •