【问题标题】:geo:latitude,longitude?z=zoom in android taking me to my current locationgeo:latitude,longitude?z=zoom in android 带我到我当前的位置
【发布时间】:2012-05-08 23:22:19
【问题描述】:

我想从我的应用中调用内置地图应用。我遇到了this link。这个页面也给了我this link,在那里我真的可以得到我想要的。我知道

geo:latitude,longitude?z=zoom

仍处于开发模式。

我的问题是,当我使用它时,它会到达所需的位置,然后将我转移到我当前的位置。

这是我正在使用的代码

String uri = String.format("geo:%f,%f?z=18",(float)(latitude /1E6),(float)(longitude/1E6));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);

我该如何解决?

【问题讨论】:

  • 什么是lat和long值你也可以粘贴你的代码
  • 提供足够的代码,你就会得到解决方案

标签: android maps location coordinates


【解决方案1】:

你可以试试这个.....

Intent mapintent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("geo:0,0?q="+lat_string+long_string+"(Title_to_show)"));

lat_stringlong_string 是原始格式,即76.6464831 35.494 的东西..

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-23
    相关资源
    最近更新 更多