2017-04-19 106 views
1

enter image description here如何去除標籤上的谷歌地圖應用

喜「由...提供」,

我有意向的谷歌地圖應用到特定位置打開。 是否可以刪除(屏幕截圖上的紅色圓圈)提供的左下角的標籤?

我用在Android這個方法打開谷歌地圖的特定位置:

/** 
* 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); 
} 

回答

2

你必須稍微改變您的查詢。現在你的URI是

geo:lat,lng?q=lat,lng(label) 

改變,要

geo:lat,lng?q=label 

documentation不是當添加provided by信息關於很清楚。可能當您通過圓括號添加自己的標籤時。

這裏的訣竅是避免添加自己的標籤,而是將其用作搜索查詢。根據你用作標籤的情況,谷歌應該足夠聰明以找到那個地方,並顯示一個本地化的標籤。

+0

它的工作原理。謝謝! –