【问题标题】:BlackBerry maps location document with multiple pointsBlackBerry 用多个点映射位置文档
【发布时间】:2012-03-29 22:09:32
【问题描述】:

当我在我的应用程序中使用来自 How To - Invoke BlackBerry Maps 的 RIM 代码实现 BlackBerry 地图时,我的地图在安大略点上运行良好,但是当我使用 纬度 13.083333 和经度:80.283333,它不起作用。

那个点呢?在跳过点时,它显示的位置不正确。

String document = "<lbs>
<location lon='-8030000' lat='4326000' label='Kitchener, ON' description='Kitchener, Ontario, Canada' />
<location lon='-7569792' lat='4542349' label='Ottawa, ON' description='Ottawa, Ontario, Canada' />

";

【问题讨论】:

  • 我不知道这是什么意思:“点呢?跳过点时,它显示的位置不正确。”
  • 您是否查看了“如何 - 调用黑莓地图”链接?给出了一些例子..在我的代码中还有 lon="-8030000" 谷歌地图中显示的实际经度是-80.30000。小数点呢???

标签: blackberry maps latitude-longitude


【解决方案1】:

正确的方法是将 LAT 和 LONG 乘以 100,000 并将其转换为整数值, 像这样:

    // LAT & LONG times 100,000, converted to integer
    int lon = (int) (80.283333 * 100000);
    int lat = (int) (13.083333 * 100000);

    String label = "Label of point on map";
    String desc = "Description of point when clicked";

    // create the location element
    StringBuffer sb = new StringBuffer();
    sb.append("<location");
    sb.append(" lon='").append(String.valueOf(lon)).append("'");
    sb.append(" lat='").append(String.valueOf(lat)).append("'");
    sb.append(" label='").append(label).append("'");
    sb.append(" description='").append(desc).append("'");
    sb.append(" />");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-22
    • 2021-03-18
    • 2016-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-19
    • 2020-10-01
    相关资源
    最近更新 更多