Commit f74f2f9f authored by Michael Ochmann's avatar Michael Ochmann
Browse files

.

parent 36dd4553
......@@ -14,8 +14,6 @@ class HeightMapViewController extends UIViewController {
this.lastX = 0;
this.translated = 0;
this.isCapturing = false;
this.mainloop = null;
}
addPoint(geoPoint) {
......@@ -54,7 +52,7 @@ class HeightMapViewController extends UIViewController {
$("#heightmap").click((element, event) => {
event.preventDefault();
this.isCapturing = !this.isCapturing;
clearInterval(this.mainloop);
clearInterval(HeightMapViewController.MAINLOOP);
this.renderCall();
});
if (!this.isCapturing && this.model.points.length === 0)
......@@ -104,7 +102,7 @@ class HeightMapViewController extends UIViewController {
this.capture();
/* capturing new points */
this.mainloop = setInterval(() => {
HeightMapViewController.MAINLOOP = setInterval(() => {
this.capture();
}, 1000);
}
......@@ -170,7 +168,6 @@ class HeightMapViewController extends UIViewController {
* clears the canvas for redrawing
*/
clear() {
console.log("CLEAR", this.translated);
let ctx = this.canvas.getContext("2d");
let width = this.canvas.width;
let height = this.canvas.height;
......@@ -203,5 +200,6 @@ class HeightMapViewController extends UIViewController {
}
}
HeightMapViewController.BACKGROUND = "#ccc";
HeightMapViewController.MAINLOOP = null;
export default HeightMapViewController;
\ No newline at end of file
......@@ -73,6 +73,7 @@ class ViewController extends UIViewController {
}
changeState(newState) {
clearInterval(HeightMapViewController.MAINLOOP);
this.state = newState;
Settings.set("appState", newState);
this.renderCall();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment