This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drawing line on Google Maps using Latitude and Longitude from MySQL table.

 
Bat-Erdene Erdenetsogt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Help. I need to draw race route on Google Map and run Object on that line using Javascript. It's urgent
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15281
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

So, what exactly have you tried and where did you get stuck? Please be more specific with your question, so that we can help you with the exact problem you're having trouble with. Do you know how to use the Google Maps API?

Bat-Erdene Erdenetsogt wrote:It's urgent

Please ease up.
 
Bat-Erdene Erdenetsogt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:Welcome to the Ranch!

So, what exactly have you tried and where did you get stuck? Please be more specific with your question, so that we can help you with the exact problem you're having trouble with. Do you know how to use the Google Maps API?

Bat-Erdene Erdenetsogt wrote:It's urgent

Please ease up.


I'm just a beginner at Google API. I retrieved my database. And imported Google API to my site. My problem is the latitude and longitude are retrieved from GPS tracker so database has over 1000. So I can't write every line like new google.maps.LatLng etc. I hope you understand me. Sorry I'm not very good at english.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bat-Erdene Erdenetsogt wrote:I retrieved my database. And imported Google API to my site. My problem is the latitude and longitude are retrieved from GPS tracker so database has over 1000.

And is this a Java problem, or Javascript? The two are not the same, and you've come to the Java forum.
I'll be happy to move this Thread if you like.

So I can't write every line like new google.maps.LatLng etc. I hope you understand me. Sorry I'm not very good at english.

No, I'm afraid that last bit lost me. What do you mean by 'write every line like new google.maps.LatLng'? Is this a class constructor?

Winston
 
Bat-Erdene Erdenetsogt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
And is this a Java problem, or Javascript? The two are not the same, and you've come to the Java forum.
I'll be happy to move this Thread if you like.


Why not feel free to move it.

Winston Gutkowski wrote:No, I'm afraid that last bit lost me. What do you mean by 'write every line like new google.maps.LatLng'? Is this a class constructor?


It's a Google API function, i think. I'm not expert on javascript. Is there a way to use Google Map in Java? If there is I would happily use Java. My problems would solve if I can use Google Map API on JApplet.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bat-Erdene Erdenetsogt wrote:Why not feel free to move it.

Done. Moved to 'Other Languages' as there is no specific 'Javascript' forum.

Winston
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bat-Erdene Erdenetsogt wrote:My problem is the latitude and longitude are retrieved from GPS tracker so database has over 1000. So I can't write every line like new google.maps.LatLng etc.


I don't see why that is a problem. I have written programs which extract data from my GPS tracks and produce Google Maps from them. Here's an example: Keld to Grinton.

The way I did that was to read the XML file and output an HTML document including Javascript, and the Javascript uses the Google Maps API. Don't look at my example too seriously because I think it uses an old version of the Google Maps API, but the new version is fundamentally similar.

I used XSLT to produce this page, but you could certainly use Java to read the GPS track and output an HTML document. So you'll see that it doesn't matter how many points you have, you're just going to process them in a loop and produce one Google Map point for each point in your database. Here's how to think about it: first decide what you want your HTML file to look like. Make up some small examples (just a few points) by hand and make sure they work. Then write your Java code to produce real output which works the same way as your small examples.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic