Merge pull request #183 from CartoDB/inertia

Matches inertia effect to Leaflet's
This commit is contained in:
Francisco Dans 2015-05-06 10:59:49 +02:00
commit feccf2809b
3 changed files with 6 additions and 11 deletions

View File

@ -9,20 +9,10 @@ JS_CLIENT_FILES= lib/torque/*.js \
lib/torque/leaflet/canvas_layer.js \ lib/torque/leaflet/canvas_layer.js \
lib/torque/leaflet/torque.js lib/torque/leaflet/torque.js
all: dist/torque.js dist/torque.full.js
dist/torque.full.uncompressed.js: dist_folder dist/torque.uncompressed.js dist/torque.full.uncompressed.js: dist_folder dist/torque.uncompressed.js
$(BROWSERIFY) lib/torque/index.js --standalone torque > dist/torque.full.uncompressed.js $(BROWSERIFY) lib/torque/index.js --standalone torque > dist/torque.full.uncompressed.js
dist/torque.full.js: dist_folder dist/torque.full.uncompressed.js
$(UGLIFYJS) dist/torque.full.uncompressed.js > dist/torque.full.js
dist/torque.uncompressed.js: dist_folder $(JS_CLIENT_FILES)
$(BROWSERIFY) lib/torque/index.js --no-bundle-external --standalone torque > dist/torque.uncompressed.js
dist/torque.js: dist_folder dist/torque.uncompressed.js
$(UGLIFYJS) dist/torque.uncompressed.js > dist/torque.js
dist_folder: dist_folder:
mkdir -p dist mkdir -p dist

1
NEWS
View File

@ -1,6 +1,7 @@
2.11.3 2.11.3
- Limited sprite radius to a maximum of 255px - Limited sprite radius to a maximum of 255px
- Fixed custom marker-file functionality in Firefox - Fixed custom marker-file functionality in Firefox
- Fixed inertia mismatch of Torque's canvas layer
2.11.2 2.11.2
- Added error handling to Torque - Added error handling to Torque
- Fixed 'remove' event triggering when removing a Torque layer. - Fixed 'remove' event triggering when removing a Torque layer.

View File

@ -85,7 +85,7 @@ L.CanvasLayer = L.Class.extend({
}, this); }, this);
map.on({ 'viewreset': this._reset }, this); map.on({ 'viewreset': this._reset }, this);
map.on('move', this.render, this); map.on('move', this.redraw, this);
map.on('resize', this._reset, this); map.on('resize', this._reset, this);
if (this.options.zoomAnimation) { if (this.options.zoomAnimation) {
@ -232,6 +232,10 @@ L.CanvasLayer = L.Class.extend({
// use direct: true if you are inside an animation frame call // use direct: true if you are inside an animation frame call
redraw: function(direct) { redraw: function(direct) {
var domPosition = L.DomUtil.getPosition(this._map.getPanes().mapPane);
if (domPosition) {
L.DomUtil.setPosition(this._canvas, { x: -domPosition.x, y: -domPosition.y });
}
if (direct) { if (direct) {
this.render(); this.render();
} else { } else {