Heatmap: Max radiusPixels or expression in other units
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Target Use case
I am currently in a situation, where I want to control the radiusPixels to be as accurate as possible to a meter value in real-world terms.
Currently the maximum pixel value is 100 as seen here:
Before seeing this limitation, my idea was to increase/decrease the radiusPixels based on zoom level:
const getMetersPerPixel = (latitude: number, zoomLevel: number) => {
const earthCircumference = 40075017;
const latitudeRadians = latitude * (Math.PI / 180);
return (
(earthCircumference * Math.cos(latitudeRadians)) /
Math.pow(2, zoomLevel + 9)
);
};
const getMetersInPixelValue = (
latitude: number,
meters: number,
zoomLevel: number
) => {
return meters / getMetersPerPixel(latitude, zoomLevel);
};
Proposed feature
Being able to control the value as either meter, kilometer or pixel where pixel would be the default value, where the heat-map would automatically adjust for zoom. Alternatively, it could stay as pixels but being able to handle values above 100.
To Do List
- Add label and assign to milestone
- Coding
- Doc update
- What’s new update
- Test
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 with modules/aggregation-layers/src/heatmap-layer/heatmap-layer.js at the radiusPixels limit cited in the issue. First resolve whether the scope is unit-aware radius values or pixel values above 100; done should include the agreed behavior, implementation, documentation, and tests listed in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100