Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android Google map API v2 doesn't display street names

I'm displaying a map using google maps API v2 but it doesn't show any street names. It shows the satellite image but no text. What am I doing wrong here?

@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();
}
like image 248
user2246120 Avatar asked Dec 12 '25 22:12

user2246120


1 Answers

This works as designed. You are setting the map in Satellite mode and according to https://developers.google.com/maps/documentation/android/map#map_types

Satellite

Satellite photograph data. Road and feature labels are not visible.

Hybrid

Satellite photograph data with road maps added. Road and feature labels are also visible.

So you'll need to use the following if you want the labels to show:

GoogleMap map;
...
// Sets the map type to be "hybrid"
map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
like image 193
ddewaele Avatar answered Dec 15 '25 22:12

ddewaele



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!