mapbox / mapbox/mapbox-maps-flutter
Heatmap Layer works incorrect in mapbox_maps_flutter package
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to add HeatmapLayer using .geojson file and instead of showing heatmap it's just filling in all map with the color that is set as "heatmapColor". However, if I add LineLayer(or any other layer) with same .geojson file it works perfect.
What's wrong with the code below?
```
final data = await rootBundle.loadString(GeojsonFiles.heatmap);
await _controller?.style
.addSource(GeoJsonSource(id: 'heatmap', data: data));
await _controller?.style.addLayer(
HeatmapLayer(
id: 'heatmap_layer',
sourceId: 'heatmap',
heatmapColor: 0xff00ff00,
heatmapOpacity: 0.2,
),
);
await _controller?.style.addLayer(
LineLayer(
id: 'line_layer',
sourceId: 'heatmap',
lineColor: 0xffff0000,
),
);
```
I've tried to change properties of HeatmapLayer class, but nothing changed
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the shown GeoJsonSource, HeatmapLayer, and LineLayer setup in mapbox_maps_flutter, using the GeojsonFiles.heatmap data. Compare the heatmap rendering with the line rendering and inspect the HeatmapLayer source requirements. Done means the same GeoJSON displays a heatmap rather than filling the map with one color.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100