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
3b04f8d7
Commit
3b04f8d7
authored
May 16, 2018
by
Michael Ochmann
Browse files
.
parent
2a2b2872
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/index.html
View file @
3b04f8d7
...
...
@@ -21,7 +21,9 @@
</canvas>
</main>
<footer></footer>
<footer>
<b>
Points:
</b>
<span
id=
points
></span>
</footer>
</body>
</html>
\ No newline at end of file
src/javascript/App.js
View file @
3b04f8d7
...
...
@@ -13,12 +13,18 @@ class App {
this
.
heightmap
=
new
HeightMap
();
this
.
capture
();
setInterval
(()
=>
{
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
this
.
heightmap
.
addPoint
(
new
GeoPoint
(
position
.
latitude
,
position
.
longitude
,
position
.
altitude
));
});
this
.
capture
();
},
1000
);
}
capture
()
{
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
this
.
heightmap
.
addPoint
(
new
GeoPoint
(
position
.
latitude
,
position
.
longitude
,
position
.
altitude
));
});
}
}
export
default
App
;
\ No newline at end of file
src/javascript/HeightMap.js
View file @
3b04f8d7
...
...
@@ -42,9 +42,11 @@ class HeightMap {
addPoint
(
geoPoint
)
{
if
(
geoPoint
.
constructor
.
name
!==
"
GeoPoint
"
)
throw
new
TypeError
(
"
an object of type 'GeoPoint' must be passed.
"
);
if
(
this
.
points
.
length
>
0
&&
this
.
points
[
0
].
distance
(
geoPoint
)
<
5
0
)
if
(
this
.
points
.
length
>
0
&&
this
.
points
[
0
].
distance
(
geoPoint
)
<
5
)
return
;
$
(
"
#points
"
).
html
(
this
.
points
.
length
);
let
min
=
this
.
min
;
let
max
=
this
.
max
;
...
...
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