我正在使用 google maps API v2 显示 map ,但它不显示任何街道名称。它显示卫星图像但没有文字。我在这里做错了什么?
@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();
}
最佳答案
这按设计工作。您正在卫星模式下并根据 https://developers.google.com/maps/documentation/android/map#map_types 设置 map
卫星
卫星照片数据。道路和特征标签不可见。
混合
添加了路线图的卫星照片数据。道路和特征标签也可见。
因此,如果您希望显示标签,则需要使用以下内容:
GoogleMap map;
...
// Sets the map type to be "hybrid"
map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
关于android Google map API v2 不显示街道名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17311342/