Package com.google.maps.android.heatmaps
Class HeatmapTileProvider
- java.lang.Object
-
- com.google.maps.android.heatmaps.HeatmapTileProvider
-
- All Implemented Interfaces:
com.google.android.gms.maps.model.TileProvider
public class HeatmapTileProvider extends java.lang.Object implements com.google.android.gms.maps.model.TileProvider
Tile provider that creates heatmap tiles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HeatmapTileProvider.Builder
Builder class for the HeatmapTileProvider.
-
Field Summary
Fields Modifier and Type Field Description static Gradient
DEFAULT_GRADIENT
Default gradient for heatmap.static double
DEFAULT_OPACITY
Default opacity of heatmap overlaystatic int
DEFAULT_RADIUS
Default radius for convolution
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.android.gms.maps.model.Tile
getTile(int x, int y, int zoom)
Creates tile.void
setData(java.util.Collection<com.google.android.gms.maps.model.LatLng> data)
Changes the dataset the heatmap is portraying.void
setGradient(Gradient gradient)
Setter for gradient/color map.void
setMaxIntensity(double intensity)
Setter for max intensity User should clear overlay's tile cache (using clearTileCache()) after calling this.void
setOpacity(double opacity)
Setter for opacity User should clear overlay's tile cache (using clearTileCache()) after calling this.void
setRadius(int radius)
Setter for radius.void
setWeightedData(java.util.Collection<WeightedLatLng> data)
Changes the dataset the heatmap is portraying.
-
-
-
Field Detail
-
DEFAULT_RADIUS
public static final int DEFAULT_RADIUS
Default radius for convolution- See Also:
- Constant Field Values
-
DEFAULT_OPACITY
public static final double DEFAULT_OPACITY
Default opacity of heatmap overlay- See Also:
- Constant Field Values
-
DEFAULT_GRADIENT
public static final Gradient DEFAULT_GRADIENT
Default gradient for heatmap.
-
-
Method Detail
-
setWeightedData
public void setWeightedData(java.util.Collection<WeightedLatLng> data)
Changes the dataset the heatmap is portraying. Weighted. User should clear overlay's tile cache (using clearTileCache()) after calling this.- Parameters:
data
- Data set of points to use in the heatmap, as LatLngs. Note: Editing data without calling setWeightedData again will not update the data displayed on the map, but will impact calculation of max intensity values, as the collection you pass in is stored. Outside of changing the data, max intensity values are calculated only upon changing the radius.
-
setData
public void setData(java.util.Collection<com.google.android.gms.maps.model.LatLng> data)
Changes the dataset the heatmap is portraying. Unweighted. User should clear overlay's tile cache (using clearTileCache()) after calling this.- Parameters:
data
- Data set of points to use in the heatmap, as LatLngs.
-
getTile
public com.google.android.gms.maps.model.Tile getTile(int x, int y, int zoom)
Creates tile.- Specified by:
getTile
in interfacecom.google.android.gms.maps.model.TileProvider
- Parameters:
x
- X coordinate of tile.y
- Y coordinate of tile.zoom
- Zoom level.- Returns:
- image in Tile format
-
setGradient
public void setGradient(Gradient gradient)
Setter for gradient/color map. User should clear overlay's tile cache (using clearTileCache()) after calling this.- Parameters:
gradient
- Gradient to set
-
setRadius
public void setRadius(int radius)
Setter for radius. User should clear overlay's tile cache (using clearTileCache()) after calling this.- Parameters:
radius
- Radius to set
-
setOpacity
public void setOpacity(double opacity)
Setter for opacity User should clear overlay's tile cache (using clearTileCache()) after calling this.- Parameters:
opacity
- opacity to set
-
setMaxIntensity
public void setMaxIntensity(double intensity)
Setter for max intensity User should clear overlay's tile cache (using clearTileCache()) after calling this.- Parameters:
intensity
- intensity to set
-
-