I'm attempting to create a heatmap using the google api, but have come across a small problem.
Here is the sample code:
mProvider = new HeatmapTileProvider.Builder()
.weightedData((Collection<WeightedLatLng>) weightedList)
.gradient(gradient);
mOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider((TileProvider) mProvider));// this is the line of code that produces the error
}
In particular, the argument "mProvider" in that line is highlighted.
The error log is:
java.lang.ClassCastException: com.google.maps.android.heatmaps.HeatmapTileProvider$Builder cannot be cast to com.google.android.gms.maps.model.TileProvider