Maps SDK for Android v.3.0.0 BETA

Version 3.0.0 beta of the Maps SDK for Android is a new implementation with the same API surface as the previous version (all classes and methods remain the same). The main areas of change are as follows:

  • The Maps SDK for Android is now distributed via a standalone static library. Previously, the Maps SDK for Android was made available as part of Google Play services.
  • Android 4.0-4.0.4 ("Ice Cream Sandwich") is no longer supported.
  • Map rendering has been modernized and improved.
  • Text labels for POIs are now clickable, rather than just the icon.
  • Business POIs are now visible in indoor maps.
  • Added incident reports icons to the traffic layer, such as roadworks, crashes, and traffic jams. These show in Normal, Hybrid and Terrain mode.
  • Added support for 3D buildings with full models, e.g. Eiffel Tower.
  • Increased opacity of 3D buildings to match the Google Maps application.
  • Resolved an issue where markers were loading slowly (Issue 35822423).

Install the Maps SDK for Android client library

Follow these steps to manually add the v3.0.0 Beta Maps SDK for Android client library to your Android Studio project.

  1. Download the libraries:

  2. Copy the AAR file(s) into the app/libs folder of your Android Studio project.
  3. In your project-level build.gradle file, add a flatDir section to the allprojects/repositories section, as shown in the following example:

  4. allprojects {
      repositories {
          google()
          jcenter()
          flatDir {
              dirs 'libs'
          }
      }
    }
    
  5. In your app-level build.gradle, adjust the targetSdkVersion and compileSdkVersion to API level 28, and minSdkVersion to 16.
  6. Add dependencies for the client libraries to the dependencies section of your app-level build.gradle. The Places SDK for Android dependency is optional, include it only if your app also uses the Places SDK for Android. You can skip this step if you're using a wildcard (for example include: ['*.aar']).

    implementation name:'maps-sdk-3.0.0-beta', ext:'aar'
    implementation name:'places-maps-sdk-3.0.0-beta', ext:'aar'
    
  7. Add all of the other dependencies to the dependencies section of your app-level build.gradle file as follows (some of these are common dependencies, so make sure to check for duplication):
  8. dependencies {
      implementation 'com.android.support:support-v4:+'
      implementation 'com.android.support:appcompat-v7:+'
      implementation 'com.google.android.gms:play-services-basement:15.0.1'
      implementation 'com.google.android.gms:play-services-base:15.0.1'
      implementation 'com.google.android.gms:play-services-gcm:15.0.1'
      implementation 'com.google.android.gms:play-services-location:15.0.1'
    }
    
  9. In the dependencies section of your app-level build.gradle file, remove the implementation line for the previous version (it will appear similar to the following):

  10. implementation 'com.google.android.gms:play-services-maps:16.0.0'

    If you are using the Google Maps APIs Premium Plan, the implementation line to remove looks like one of the following:

    implementation(name:'google-maps-sdk-m4b', ext:'aar')
    implementation project(':googlemapssdkm4b_lib')
    
  11. Sync your Gradle project.
  12. Convert existing configurations.

    • If your existing app uses the Maps SDK for Android via Google Play services, replace all references to the com.google.android.gms.maps package with the com.google.android.libraries.maps package (use Edit > Replace in Path... in Android Studio).
    • If your existing app uses the Google Maps APIs Premium Plan, replace all references to the com.google.android.m4b.maps package with the com.google.android.libraries.maps package. Also, remove the m4b_ prefix from all references to the XML layout attributes. For example: m4b_mapType should become mapType and m4b_cameraZoom should become cameraZoom.

Import the beta-compatible utility library

If you are using the Google Maps Android API utility library, you will need to also update your project dependencies to replace the existing version with the beta-compatible version by doing the following:

1. Import the beta-compatible util library in your build.gradle file:
implementation 'com.google.maps.android:android-maps-utils-sdk-v3-compat:0.1'
2. Remove the following from your build.gradle to remove non-beta-compatible utility library:
implementation 'com.google.maps.android:android-maps-utils:0.5+'

Run the samples

The Google Samples repository on GitHub includes sample apps that demonstrate the use of the v3.0.0 Beta Maps SDK for Android.

Şunun hakkında geri bildirim gönderin...

Maps SDK for Android
Yardım mı gerekiyor? Destek sayfamızı ziyaret edin.