你好,
我带着意图打开了谷歌地图应用程序到特定位置。是否可以删除由(在屏幕截图上的红色圆圈中)提供的左下角的标签?
我在 Android 上使用此方法将 Google 地图打开到特定位置:
/**
* Open Google Maps to specific coordinates and show the name of the place with the label
* @param context the {@link Context}
* @param latitude the latitude
* @param longitude the longitude
* @param label the name of the place
*/
public static void openGoogleMaps(Context context, double latitude, double longitude, String label) {
String uriBegin = "geo:" + latitude + "," + longitude;
String query = latitude + "," + longitude + "(" + label + ")";
String encodedQuery = Uri.encode(query);
String uriString = uriBegin + "?q=" + encodedQuery + "&z=16";
Uri uri = Uri.parse(uriString);
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, uri);
context.startActivity(intent);
}
您必须稍微更改您的查询。现在你的uri是
geo:lat,lng?q=lat,lng(label)
将其更改为
geo:lat,lng?q=label
该文档是不能当约很清楚provided by
添加信息。可能当您通过括号添加自己的标签时。
这里的技巧是避免添加您自己的标签,而是将其用作搜索查询。根据您用作标签的内容,谷歌应该足够聪明,无论如何都能找到那个地方,并显示一个本地化的标签。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句