Skip to content

Commit 3b7fabe

Browse files
Merge pull request #4 from hughlomas/master
Fix getMaxZoom to use props.maxZoom
2 parents bc6161d + eca87ba commit 3b7fabe

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.2.1 Release
2+
3+
- Fix getMaxZoom returning props.radius instead of props.maxZoom, fix misnamed call to getMax instead of getMaxZoom in redraw()
4+
15
# 0.2.0 Release
26

37
- adds an `onStatsUpdate` prop which is called on redraw with a { min, max } object containing the min and max number of items found for a single coordinate

lib/HeatmapLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var HeatmapLayer = function (_MapLayer) {
114114
};
115115

116116
HeatmapLayer.prototype.getMaxZoom = function getMaxZoom(props) {
117-
return props.radius || 18;
117+
return props.maxZoom || 18;
118118
};
119119

120120
HeatmapLayer.prototype.getMinOpacity = function getMinOpacity(props) {
@@ -236,7 +236,7 @@ var HeatmapLayer = function (_MapLayer) {
236236

237237
var maxIntensity = this.props.max === undefined ? 1 : this.getMax(this.props);
238238

239-
var maxZoom = this.props.maxZoom === undefined ? this.props.map.getMaxZoom() : this.getMax(this.props);
239+
var maxZoom = this.props.maxZoom === undefined ? this.props.map.getMaxZoom() : this.getMaxZoom(this.props);
240240

241241
var v = 1 / Math.pow(2, Math.max(0, Math.min(maxZoom - this.props.map.getZoom(), 12)));
242242

src/HeatmapLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default class HeatmapLayer extends MapLayer {
110110
}
111111

112112
getMaxZoom(props) {
113-
return props.radius || 18;
113+
return props.maxZoom || 18;
114114
}
115115

116116
getMinOpacity(props) {
@@ -237,7 +237,7 @@ export default class HeatmapLayer extends MapLayer {
237237

238238
const maxZoom = this.props.maxZoom === undefined
239239
? this.props.map.getMaxZoom()
240-
: this.getMax(this.props);
240+
: this.getMaxZoom(this.props);
241241

242242
const v = 1 / Math.pow(
243243
2,

0 commit comments

Comments
 (0)