Skip to content

Repository files navigation

MapConductor Heatmap

Description

MapConductor Heatmap is a map-implementation-agnostic heatmap overlay for the MapConductor SDK. It renders heatmap data as a tile-based RasterLayer so it works with any map implementation (Google Maps, MapLibre, Mapbox, ArcGIS, HERE, etc.).

Setup

https://mapconductor.com/setup/


Usage

Basic HeatmapOverlay

Place HeatmapOverlay inside any XxxMapView content block and add points with HeatmapPoint:

XxxMapView(...) {
HeatmapOverlay(
radiusPx =20,
opacity =0.7,
) {
HeatmapPoint(
position =GeoPoint(latitude =35.6762, longitude =139.6503),
weight =1.0,
)
HeatmapPoint(
position =GeoPoint(latitude =35.6895, longitude =139.6917),
weight =2.5,
)
}
}

HeatmapPoints (batch)

For large datasets, use HeatmapPoints to add all points in a single update:

val pointStates:List<HeatmapPointState> = remember { buildPointList() }
XxxMapView(...) {
HeatmapOverlay(radiusPx =20) {
HeatmapPoints(pointStates)
}
}

HeatmapOverlayState

Use HeatmapOverlayState to control heatmap properties dynamically:

val heatmapState = remember {
HeatmapOverlayState(
radiusPx =20,
opacity =0.7,
gradient =HeatmapGradient.DEFAULT,
)
}
// Update dynamically
heatmapState.radiusPx =30
heatmapState.opacity =0.5XxxMapView(...) {
HeatmapOverlay(state = heatmapState) {
HeatmapPoints(pointStates)
}
}

Custom HeatmapGradient

val gradient =HeatmapGradient(
listOf(
HeatmapGradientStop(position =0.0, color =Color.argb(0, 0, 0, 255)), // transparent blueHeatmapGradientStop(position =0.5, color =Color.rgb(0, 255, 0)), // greenHeatmapGradientStop(position =1.0, color =Color.rgb(255, 0, 0)), // red
)
)
val heatmapState = remember {
HeatmapOverlayState(gradient = gradient)
}

HeatmapPointState

HeatmapPointState allows per-point customization:

val pointState =HeatmapPointState(
position =GeoPoint(latitude =35.6762, longitude =139.6503),
weight =3.0,
)

API Reference

HeatmapOverlay

ParameterTypeDefaultDescription
radiusPxInt20Blur radius of each point in pixels
opacityDouble0.7Layer opacity (0.0–1.0)
gradientHeatmapGradientHeatmapGradient.DEFAULTColor gradient
maxIntensityDouble?nullMax intensity for normalization; auto-calculated if null

HeatmapOverlayState

PropertyTypeDefault
radiusPxInt20
opacityDouble0.7
gradientHeatmapGradientHeatmapGradient.DEFAULT
maxIntensityDouble?null
weightProvider(HeatmapPointState) -> Double{ it.weight }

HeatmapGradient.DEFAULT

Green (#66E100) at position 0.2 → Red (#FF0000) at position 1.0.

About

Heatmap module for MapCondcutor

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages