转换的GeoPoint到位置 [英] Convert GeoPoint to Location

查看:323
本文介绍了转换的GeoPoint到位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个非常noobish的问题 - 但什么是转换<一个最好的方法href="http://$c$c.google.com/android/add-ons/google-apis/reference/com/google/android/maps/GeoPoint.html"><$c$c>GeoPoint到<一个href="http://developer.android.com/reference/android/location/Location.html"><$c$c>Location在Android平台。

解决方案

 双纬度= geoPoint.getLatitudeE6()/ 1E6;
双经度= geoPoint.getLongitudeE6()/ 1E6;

location.setLatitude(纬度);
location.setLongitude(经度);
 

I know this is a very noobish question -- but what is the best way to convert a GeoPoint to a Location on the Android platform.

解决方案

double latitude = geoPoint.getLatitudeE6() / 1E6;
double longitude = geoPoint.getLongitudeE6() / 1E6;

location.setLatitude(latitude);
location.setLongitude(longitude);

这篇关于转换的GeoPoint到位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆