【问题标题】:Drop pin in MapView在 MapView 中放置图钉
【发布时间】:2010-04-23 06:51:41
【问题描述】:

我读到这个: Drop Pin on Default Google Maps from My App in Android? 并做同样的事情。 但是在我打电话后,地图上没有图钉掉下来: startActivity(new Intent(Intent.ACTION_VIEW, uri));

地图以该 uri 位置为中心,但地图上没有放置任何图钉。

那么,有一个问题: 如何在地图上放置图钉?

【问题讨论】:

  • 嘿,你能告诉我你做了什么吗?它对我来说很酷。
  • prev_geo_uri = Uri.parse("geo: "+prevLocation.getLatitude()+","+prevLocation.getLongitude()); startActivity(new Intent(Intent.ACTION_VIEW,prev_geo_uri));
  • [Here][1] 是 Android [1] MapView 上 DragAndDrop 的完整代码:stackoverflow.com/questions/3897409/…

标签: android maps android-maps


【解决方案1】:

您也需要添加一些要搜索的内容(q 参数)。如果您只有 lon/lat,请按以下方式指定两次:

Uri uri = Uri.parse("geo:36.4248,-5.14495?z=14&q=36.4248,-5.14495"); 
Intent intent = new Intent(Intent.ACTION_VIEW, uri); 
startActivity(intent); 

注意 z 参数是可选的。

您还可以通过将其添加到 q 的 lon 之后的括号中来标记引脚,即

Uri uri = Uri.parse("geo:36.4248,-5.14495?z=14&q=36.4248,-5.14495(My+pin+label)"); 
Intent intent = new Intent(Intent.ACTION_VIEW, uri); 
startActivity(intent); 

【讨论】:

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