Skip to content

Commit

Permalink
Merge pull request #3 from ZuchaoWang/zcwang
Browse files Browse the repository at this point in the history
Added 'this' in _zoomCalc, fixes issue#2
  • Loading branch information
xEviL committed Mar 5, 2015
2 parents 9b7ed9b + 80bf0e2 commit 4edb6a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions L.D3SvgOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ L.D3SvgOverlay = L.Class.extend({
// "zoomanim"/"viewreset" event handler: calculate shift/scale values
_zoomCalc: function (evt) {
// Compute and store coordinates to animate to
var newZoom = evt.zoom || map._zoom; // "viewreset" event in Leaflet has not zoom/center parameters like zoomanim
var newZoom = evt.zoom || this.map._zoom; // "viewreset" event in Leaflet has not zoom/center parameters like zoomanim
this._zoomDiff = newZoom - this._zoom;
this._scale = Math.pow(2, this._zoomDiff);
this._shift = this.map._latLngToNewLayerPoint(this._origin, newZoom, (evt.center || map._initialCenter ));
this._shift = this.map._latLngToNewLayerPoint(this._origin, newZoom, (evt.center || this.map._initialCenter ));
},

// "zoomstart" event handler: stop running animation
Expand Down Expand Up @@ -250,4 +250,4 @@ L.D3SvgOverlay.version = "2.0";
// Factory method
L.d3SvgOverlay = function (drawCallback, options) {
return new L.D3SvgOverlay(drawCallback, options);
};
};
2 changes: 1 addition & 1 deletion L.D3SvgOverlay.min.js

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

0 comments on commit 4edb6a2

Please sign in to comment.