Skip to content

Commit

Permalink
RD-318: propagating the beforeId option on heatmap layer helper (#112)
Browse files Browse the repository at this point in the history
* propagating the beforeId option on heatmap layer helper

* linting
  • Loading branch information
jonathanlurie authored Sep 6, 2024
1 parent 7f4af0f commit 5f036b4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Bug Fixes
- Updating from MapLibre v4.4.1 to v4.6.0. See Maplibre changelogs for [v4.5.0](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#450), [v4.5.1](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#451), [v4.5.2](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#452), and [v4.6.0](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#460)
- Fixed the elevation shift glitch happening with terrain animation after calling `.easeTo()` (https://github.com/maptiler/maptiler-sdk-js/pull/110)
- The heatmap layer helper missed the `beforeId` option
### New Features
- Updating from MapLibre v4.4.1 to v4.5.2, adding the following features. See Maplibre changelogs for for [v4.5.0](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#450), [v4.5.1](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#451), [v4.5.2](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#452), and [v4.6.0](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#460)
### Others
Expand Down
49 changes: 26 additions & 23 deletions src/helpers/vectorlayerhelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1329,30 +1329,33 @@ export function addHeatmap(
});
}

map.addLayer({
id: layerId,
type: "heatmap",
source: sourceId,
minzoom,
maxzoom,
paint: {
"heatmap-weight": heatmapWeight,

"heatmap-intensity":
typeof intensity === "number"
? intensity
: (rampedOptionsToLayerPaintSpec(intensity) as PropertyValueSpecification<number>),

"heatmap-color": heatmapIntensityFromColorRamp(colorRamp),

"heatmap-radius": radiusHeatmap,

"heatmap-opacity":
typeof opacity === "number"
? opacity
: (rampedOptionsToLayerPaintSpec(opacity) as PropertyValueSpecification<number>),
map.addLayer(
{
id: layerId,
type: "heatmap",
source: sourceId,
minzoom,
maxzoom,
paint: {
"heatmap-weight": heatmapWeight,

"heatmap-intensity":
typeof intensity === "number"
? intensity
: (rampedOptionsToLayerPaintSpec(intensity) as PropertyValueSpecification<number>),

"heatmap-color": heatmapIntensityFromColorRamp(colorRamp),

"heatmap-radius": radiusHeatmap,

"heatmap-opacity":
typeof opacity === "number"
? opacity
: (rampedOptionsToLayerPaintSpec(opacity) as PropertyValueSpecification<number>),
},
},
});
options.beforeId,
);

return returnedInfo;
}

0 comments on commit 5f036b4

Please sign in to comment.