mapbox / mapbox/mapbox-maps-flutter

Heatmap Layer works incorrect in mapbox_maps_flutter package

Open
#80 3 comments 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.