Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michael Ochmann
trakr.
Commits
ac02a419
Commit
ac02a419
authored
Jul 15, 2018
by
Michael Ochmann
Browse files
printing accuracy to screen
parent
8927dd42
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/javascript/controllers/HeightMapViewController.js
View file @
ac02a419
...
@@ -21,9 +21,11 @@ class HeightMapViewController extends UIViewController {
...
@@ -21,9 +21,11 @@ class HeightMapViewController extends UIViewController {
this
.
lastX
=
0
;
this
.
lastX
=
0
;
this
.
translated
=
0
;
this
.
translated
=
0
;
this
.
isCapturing
=
false
;
this
.
isCapturing
=
false
;
this
.
currentAcc
=
0
;
this
.
addSubview
(
new
MapController
(
"
#osm
"
,
this
.
model
));
this
.
addSubview
(
new
MapController
(
"
#osm
"
,
this
.
model
));
navigator
.
geolocation
.
watchPosition
(
position
=>
{
navigator
.
geolocation
.
watchPosition
(
position
=>
{
this
.
currentAcc
=
position
.
coords
.
accuracy
;
if
(
!
this
.
isCapturing
||
position
.
coords
.
accuracy
>
10
)
if
(
!
this
.
isCapturing
||
position
.
coords
.
accuracy
>
10
)
return
;
return
;
this
.
addPoint
(
new
GeoPoint
(
this
.
addPoint
(
new
GeoPoint
(
...
@@ -178,11 +180,13 @@ class HeightMapViewController extends UIViewController {
...
@@ -178,11 +180,13 @@ class HeightMapViewController extends UIViewController {
ctx
.
font
=
"
bold 23px Arial
"
;
ctx
.
font
=
"
bold 23px Arial
"
;
ctx
.
textAlign
=
"
right
"
;
ctx
.
textAlign
=
"
right
"
;
ctx
.
fillText
(
`Datapoints:
${
this
.
model
.
points
.
length
}
`
,
this
.
canvas
.
width
-
20
,
32
);
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
.
textAlign
=
"
left
"
;
ctx
.
font
=
"
18px Arial
"
;
ctx
.
font
=
"
18px Arial
"
;
ctx
.
fillText
(
`–
${
Math
.
round
(
this
.
model
.
min
)}
m`
,
10
,
height
-
22
);
ctx
.
fillText
(
`–
${
Math
.
round
(
this
.
model
.
min
)}
m`
,
10
,
height
-
22
);
ctx
.
fillText
(
`–
${
Math
.
round
(
this
.
model
.
max
)}
m`
,
10
,
32
);
ctx
.
fillText
(
`–
${
Math
.
round
(
this
.
model
.
max
)}
m`
,
10
,
32
);
/* draw "play button" */
if
(
!
this
.
isCapturing
)
{
if
(
!
this
.
isCapturing
)
{
let
theight
=
100
;
let
theight
=
100
;
let
twidth
=
80
;
let
twidth
=
80
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment