click and drag panning

This commit is contained in:
Gavin McDonald
2016-02-24 17:38:51 -05:00
parent 4e06b756d8
commit e78cedda18
2 changed files with 52 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ import ExWhyZee from './exWhyZee.js';
export default class Tessellate {
constructor(settings) {
['tap', 'draw', 'drawMap', 'zoom'].map(method => {this[method] = this[method].bind(this)});
['tap', 'draw', 'drawMap', 'move', 'zoom'].map(method => {this[method] = this[method].bind(this)});
this.drawCB = settings.draw || utils.noop;
this.clickCB = settings.click || utils.noop;
@@ -32,6 +32,7 @@ export default class Tessellate {
this.onTap = new OnTap({
element: this.element,
tap: this.tap,
move: this.move,
zoom: this.zoom
});
@@ -50,6 +51,10 @@ export default class Tessellate {
this.clickCB(event);
}
move(event) {
this.xyz.move(event);
}
zoom(event) {
this.xyz.zoom(event);
}