How do I show a marker in Maps launched by geo URI Intent?

后端 未结 7 1663
离开以前
离开以前 2020-11-28 02:47

I have a application where I want to show different locations (one at the time, picked by user input) by launching Google Maps with their specific geo coordinates.

I

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 03:21

    This string works well for me:

    String geoUriString="geo:"+lat+","+lon+"?q=("+head+")@"+lat+","+lon;
    Uri geoUri = Uri.parse(geoUriString);
    Log.e(TAG, "String: "+geoUriString);
    Intent mapCall  = new Intent(Intent.ACTION_VIEW, geoUri);
    startActivity(mapCall);
    

提交回复
热议问题