Skip to content

Commit

Permalink
adjust VELOCITY_SCALE by map extent
Browse files Browse the repository at this point in the history
addresses issue danwild#1, so we adjust particle animations based on current
map extent
  • Loading branch information
danwild committed Mar 29, 2017
1 parent b0407c9 commit 8d22805
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dist/leaflet-velocity.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ var Windy = function Windy(params) {
var interpolateField = function interpolateField(grid, bounds, extent, callback) {

var projection = {};
var velocityScale = VELOCITY_SCALE;
var mapArea = (extent.south - extent.north) * (extent.west - extent.east);
var velocityScale = VELOCITY_SCALE * Math.pow(mapArea, 0.4);

var columns = [];
var x = bounds.x;
Expand Down
Loading

0 comments on commit 8d22805

Please sign in to comment.