将坐标转换为String

时间:2015-10-22 12:22:03

标签: android

在我的应用程序中,我有很多这样的坐标:

String uri ="uber://action=setPickup&pickup=my_location&dropoff[latitude]=
59.936435&dropoff[longitude]=30.296409&dropoff[nickname]=Place1";

如何使用Parse.com更新它们?也许我需要用这个坐标制作String,可以用Parse.com更新?

我也有坐标谷歌地图:

mMap.addMarker(new MarkerOptions().position(new LatLng(59.624895, 30.230149)).title("Palce3"));

我如何更新它们?

1 个答案:

答案 0 :(得分:0)

您需要一个Geocoder对象。试试这个:

List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());
try {
    addresses = geocoder.getFromLocation(your_latitude, your_longitude, 1);

} catch (IOException e) {
    e.printStackTrace();
}
addresses.get(0).getAddressLine(0);

请注意,Geocoder需要互联网才能正常工作。