【问题标题】:Blackberry <location> lat and lon from googlemaps lat and lon黑莓 <location> 来自 googlemaps lat and lon 的 lat 和 lon
【发布时间】:2012-01-08 17:25:21
【问题描述】:

我有这样的坐标:

<googlemapsX>32.733611</googlemapsX>

<googlemapsY>-117.189722</googlemapsY>

我想像这样向他们展示:

String document = "<lbs>
     <location lat='LAT' lon='LON'/>
     </lbs>";

但是LAT和LON必须是整数,如何转换呢?

【问题讨论】:

  • 您是否使用 XML 解析器来获取第一位?
  • 我有 2 个双精度值:32.733611 和 -117.189722,需要将它们转换为整数以显示在 ,我的问题是如何翻译 google坐标到 bb

标签: blackberry maps coordinates


【解决方案1】:

要将它们转换为 BlackBerry 在其文档中使用的纬度/经度,您只需将它们乘以 100000 即可得到正确的值。

int lat = 32.733611 * 100000;
int lon = -117.189772 * 100000;

并将这些值用作您的 LAT 和 LON

【讨论】:

【解决方案2】:

lat、long 可以是 32.733611、-117.189772(双精度值)等值

int latitude = (int) (lat * 1e6);
int longitude = (int) (long * 1e6);

【讨论】:

    猜你喜欢
    • 2018-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多