1

I am new to Android and working through a tutorial on the developer site . I am getting stuck at the first Hurdle as it states HeatmapTileProvider cannot be resolved. The code is below:

    mProvider = new HeatmapTileProvider.Builder()
            .data(list)
            .build();

    // Add a tile overlay to the map, using the heat map tile provider.
    mOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(mProvider));

Following the error, I have tried importing HeatmapTileProvider into the project. The relevant imports:

  import com.google.android.gms.maps.model.TileOverlayOptions;
  import com.google.maps.android.heatmaps.HeatmapTileProvider;

I can import the TileOverlayOptions without any problems but HeatmapTileProvider is just greyed and says it cannot resolve Maps. I have tried different variations like:

 import com.google.android.gms.maps.heatmaps.HeatmapTileProvider;

Do I need to import something else to enable the HeatmapTileProvider to work? It doesn't indicate this in the tutorial.

androidNewbie
  • 49
  • 1
  • 1
  • 8

1 Answers1

3

If you are using Android Studio, you need to add the android-maps-utils dependency in your build.gradle:

dependencies {
    compile 'com.google.maps.android:android-maps-utils:0.4+'
}

You can take a look at the Getting Started section of the Google Maps Android API utility library project's website. There you will find how to configure your Android Studio/Gradle, Maven or Eclipse/ADT project to use the library.

antonio
  • 18,044
  • 4
  • 45
  • 61