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.