Skip to content

Commit

Permalink
Adding algorithm to only filter out hexes that are completely off the…
Browse files Browse the repository at this point in the history
… visible map
  • Loading branch information
reblace committed Aug 15, 2018
1 parent b66b10b commit 6f02722
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ Getter for the actual fps (based on the actual time between the last two animati

### Version 4.x

#### 4.2.0
- Corrected the algorithm that filters out hexbins to avoid drawing those that fall outside of the visible bounds of the map.

#### 4.1.0
- Added Hexbin Layer options for colorDomain and radiusDomain. See README docs for details.

Expand Down
6 changes: 5 additions & 1 deletion dist/leaflet-d3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/leaflet-d3.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/leaflet-d3.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"artifactName": "leaflet-d3",
"moduleName": "leafletD3",
"description": "Custom d3 layers for leaflet",
"version": "4.1.0",
"version": "4.2.0",
"author": "Asymmetrik, Ltd.",
"copyright": "Copyright (c) 2007-2018 Asymmetrik Ltd, a Maryland Corporation",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions src/js/hexbin/HexbinLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ L.HexbinLayer = L.SVG.extend({
var that = this;

// Create the bins using the hexbin layout

// Generate the map bounds (to be used to filter the hexes to what is visible)
var bounds = that._map.getBounds();
var size = that._map.getSize();
bounds = bounds.pad(that.options.radius * 2 / Math.max(size.x, size.y));

var bins = that._hexLayout(data);

Expand Down

0 comments on commit 6f02722

Please sign in to comment.