2013-06-26 103 views
1

我使用谷歌地圖API v2顯示地圖,但它不顯示任何街道名稱。它顯示衛星圖像,但沒有文字。我在這裏做錯了什麼?android谷歌地圖API v2不顯示街道名稱

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_gmaps); 

    mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); 
    map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); 
    map.setMyLocationEnabled(true); 
    map.setMapType(GoogleMap.MAP_TYPE_SATELLITE); 

    map.setInfoWindowAdapter(new MyInfoWindowAdapter(this, getLayoutInflater())); 
    map.setOnMapLongClickListener(this); 
    map.setOnInfoWindowClickListener(this); 
    map.setOnMarkerClickListener(this); 

    mMyLocation = map.getMyLocation(); 
    setMarkerOnLocation(); 
} 

回答

7

這按照設計工作。要設置衛星模式地圖,並根據https://developers.google.com/maps/documentation/android/map#map_types

衛星

衛星照片數據。道路和特徵標籤是不可見

混合

衛星照片與路線圖數據補充。道路和特徵標籤也是可見的。

所以你需要,如果你想的標籤,以顯示使用下面的:

GoogleMap map; 
... 
// Sets the map type to be "hybrid" 
map.setMapType(GoogleMap.MAP_TYPE_HYBRID); 
0

您剛纔給當前的位置,並沒有給出任何緯度和經度點

例如:

LatLng one = new LatLng(13.549881,77.711792);// 

    Marker myMarkerOne = gm.addMarker(new MarkerOptions() 
     .position(one) 
     .title("Name of location") 
     .snippet("Name of street") 
     .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));  

,如果你想獲得動態表示這是考慮使用JSON地圖解析here

+0

我不是故意的特定位置。我的意思是當地圖加載時,放大和縮小時不顯示任何街道名稱,高速公路,建築物等。這不是與api自動交付的嗎? – user2246120

+0

地圖是否看起來空白?你會添加截圖嗎?你已經添加了衛星,所以它會加載街道名稱。 – Shadow