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

printing accuracy to screen

parent 8927dd42
......@@ -21,9 +21,11 @@ class HeightMapViewController extends UIViewController {
this.lastX = 0;
this.translated = 0;
this.isCapturing = false;
this.currentAcc = 0;
this.addSubview(new MapController("#osm", this.model));
navigator.geolocation.watchPosition(position => {
this.currentAcc = position.coords.accuracy;
if (!this.isCapturing || position.coords.accuracy > 10)
return;
this.addPoint(new GeoPoint(
......@@ -178,11 +180,13 @@ class HeightMapViewController extends UIViewController {
ctx.font = "bold 23px Arial";
ctx.textAlign = "right";
ctx.fillText(`Datapoints: ${this.model.points.length}`, this.canvas.width - 20 , 32);
ctx.fillText(`Accuracy: ${this.currentAcc}m`, this.canvas.width - 20, this.canvas.height - 20);
ctx.textAlign = "left";
ctx.font = "18px Arial";
ctx.fillText(`– ${Math.round(this.model.min)}m`, 10, height - 22);
ctx.fillText(`– ${Math.round(this.model.max)}m`, 10, 32);
/* draw "play button" */
if (!this.isCapturing) {
let theight = 100;
let twidth = 80;
......
Markdown is supported
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