简体   繁体   中英

how to display multiple location on google map by their latitude and longitude?

I'm trying to display multiple location by their given latitude and longitude on google map , I have mad lots of search but all example codes are for javascript and other languages , I need to perform this using Java .here is my code to display one location and it successfully work:

 Desktop.getDesktop().browse(new URI("https://www.google.com/maps?&daddr=31.9699728,35.9141165"));

please any help !

您可以将所有位置放在一个 KML 文件中,然后在谷歌地图中显示该 KML 文件。

As Vinay wrote, you can write the coordinates into a KML file and then feed the KML file to Google Maps.

If what you need to generate is pretty simple, your best bet is probably to create a representative example in Google Earth: save a few locations in a single folder, then save it as a KML (not KMZ) file. Open it in any text editor and clean up needless crap like styles, etc., and use it as boilerplate for recreating it with your dynamically generated point coordinates in Java. If you want to write more sophisticated KML on the fly, look up libkml which AFAIK works in C++, python, and Java.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM