Reputation: 65
In my application I'm using google maps Satellite View, but its not showing all labels in my town like in Google Maps Application. Here is screenshots from my application and from Google Maps Application :
My application : My application Screenshot
Google Maps Application : Google Maps Application Screenshot
And here is my code :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_location_route);
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
if (status != ConnectionResult.SUCCESS) {
int requestCode = 10;
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
dialog.show();
}
else{
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
try {
mGoogleMap = googleMap;
mGoogleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
mGoogleMap.setMyLocationEnabled(true);
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = locationManager.getBestProvider(criteria, true);
Location location = locationManager.getLastKnownLocation(provider);
if (location != null) {
onLocationChanged(location);
}
drawYourMarker(yourLocation);
drawPharmacyMarker(pharmacyLocation);
// Checks, whether start and end locations are captured
if (yourLocation != null && pharmacyLocation != null) {
String url = getDirectionsUrl(yourLocation, pharmacyLocation);
DownloadTask downloadTask = new DownloadTask();
downloadTask.execute(url);
}
} catch (SecurityException e) {
e.printStackTrace();
}
}
Is there any way to make my application show more labels like in Google Maps application ?
Upvotes: 1
Views: 2632
Reputation: 304
You need to change Map Type
mGoogleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
to
mGoogleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
Upvotes: 1
Reputation: 426
This is because Google Maps app use all the available APIs from Google. The API you are looking for is Google Places API to get all the labels.
You have to turn it on on the Google API console and follow this tutorial to achieve put them on your map.
Hope this help.
Upvotes: 1