Skip to content

Commit

Permalink
Add min resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
vasturiano committed Sep 21, 2023
1 parent 0c488ea commit 5e0695d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/layers/heatmaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { GLOBE_RADIUS } from '../constants';
//

const RES_BW_FACTOR = 3.5; // divider of bandwidth to use in geometry resolution
const MIN_RESOLUTION = 0.1; // degrees
const BW_RADIUS_INFLUENCE = 3.5; // multiplier of bandwidth to use in octree for max radius of point influence

class PointsOctree {
Expand Down Expand Up @@ -128,7 +129,7 @@ export default Kapsule({
});

// Check resolution
const resolution = bandwidth / RES_BW_FACTOR;
const resolution = Math.max(MIN_RESOLUTION, bandwidth / RES_BW_FACTOR);
const equatorNumSegments = Math.ceil(360 / (resolution || -1));
if (obj.geometry.parameters.widthSegments !== equatorNumSegments) {
obj.geometry.dispose();
Expand Down

0 comments on commit 5e0695d

Please sign in to comment.