Issue
I'm trying to add a GoogleMap for my application.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
...
mMapView.onCreate(savedInstanceState);
MapsInitializer.initialize(context);
mMapView.getMapAsync(this);
...
}
@Override
public void onMapReady(GoogleMap googleMap) {
mGoogleMap = googleMap;
mGoogleMap.setBuildingsEnabled(true);
mGoogleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
mGoogleMap.setTrafficEnabled(true);
mGoogleMap.getUiSettings().setZoomControlsEnabled(true);
mGoogleMap.getUiSettings().setCompassEnabled(true);
}
But for some reason google map in my application shows less detailed layer of buildings than original google maps app. (Maybe there are some other differences, but buildings are vital for my app and I noticed that)
I can only force buildings to be displayed in my app if i zoom twice more. And it will be 3d buildings already. So, some buildings (those have a 3d view) are not displayed until i zoom enough to 3d buildings to show up. Others (those have no 3d view) are displayed correctly and exactliy like in google maps app.
How can I display ALL buildings in my app?
- I'm testing on Android 5.1.1
- DisplayMetrics{density=1.5, width=480, height=854, scaledDensity=1.5, xdpi=160.421, ydpi=159.497}
- Location point: https://www.google.ru/maps/@64.543017,40.5261856,16z
Solution
Google Maps native app on Android and maps in Google Maps Android API v2 currently have a different style of base map tiles. The native Google Maps app changed its look some time ago and it was announced in this article
https://www.blog.google/products/maps/google-maps-gets-new-look/
The API at present time has an old look, so you noticed the difference when you compare a native app and your application. The good news is that Google will update style of tile in the API soon and they announced this change in this blog post
https://maps-apis.googleblog.com/2018/02/updated-basemap-style-for-google-maps.html
According to the blog post a new style will be available for Maps Android API in early March 2018. So stay tuned and follow the corresponding feature request in Google issue tracker
https://issuetracker.google.com/issues/72780606
I hope my answer resolves your doubt!
UPDATE
Google announced that new basemap style are now available in Google Play services 12.0.0
Enabled opt-in for the new basemap style. To opt-in, add the following tag to your AndroidManifest.xml file, within the tags. The device must have at least Google Play Services version 12.0.0 in order for the opt-in to work. See the blog post for more information about the new style.
<meta-data android:name="com.google.android.gms.maps.API_OPTIONS"
android:value="B3MWHUG2MR0DQW"/>
Answered By - xomena
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.