简体   繁体   中英

how to get location using Latitude and Longitude in java?

我正在Servlet中使用HTml5从JSP获取经度和纬度,我想使用这两个参数来确定确切的位置(城市名称,国家名称)。建议解决此问题。

Use Google geocoding service to get the location by passing a pair of latitude and longitude...it returns the response as accurate as possible in the form of JSON or XML whichever you prefer..

Here is a link the sensor parameter is a must so make sure for a browser you say false for a device having it pass true..

so just use the HttpURLConnection class and read the response from this url and you will get the response. Parse the response for formatted_address object.

This contains the address you need.

its awesome..

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