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 ?
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.
You need to change Map Type
mGoogleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
to
mGoogleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.