geo: Intent with label (Android)

匿名 (未验证) 提交于 2019-12-03 01:00:01

问题:

Is there a working way (i heard that as of update 7.0 there were some changes) to display a marker with a position given by latitude/longitude with a label?

geo:?q=latitude, longitude (Label) does not work...

回答1:

  • Show point on google map via an intent.

    String uri = "geo:"+ latitude + "," + longitude;

startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));

  • You can also choose to place a point like so:

    String uri = "geo:"+ latitude + "," + longitude + "?q=my+street+address";

startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));

// The Possible Query params options are the following:

  • Show map at location: geo:latitude,longitude

  • Show zoomed map at location: geo:latitude,longitude?z=zoom

  • Show map at locaiton with point: geo:0,0?q=my+street+address

  • Show map of businesses in area: geo:0,0?q=business+near+city



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!