add position view

This commit is contained in:
Götz 2017-10-17 22:13:08 +02:00
parent c178976fcf
commit 674ecde707
2 changed files with 4 additions and 1 deletions

View File

@ -13,6 +13,7 @@ function getPos() {
navigator.geolocation.getCurrentPosition(function (position) { navigator.geolocation.getCurrentPosition(function (position) {
lat = position.coords.latitude; lat = position.coords.latitude;
lon = position.coords.longitude; lon = position.coords.longitude;
document.getElementById('position').innerHTML = "Lat:" + pos['lat'] + " Lon: " + pos['lon']
}, function (err) { }, function (err) {
}, geo_option) }, geo_option)
} }
@ -42,6 +43,7 @@ function loadVGNPos() {
document.getElementsByTagName('body')[0].style.visibility = "hidden" document.getElementsByTagName('body')[0].style.visibility = "hidden"
pos = getPos() pos = getPos()
console.log(pos) console.log(pos)
getVGNCoords(pos['lat'], pos['lon']) getVGNCoords(pos['lat'], pos['lon'])
} }

View File

@ -7,6 +7,7 @@
<p class="text-center">Donar</p> <p class="text-center">Donar</p>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<p id="position"></p>
<div class="row"> <div class="row">
{% if locations %} {% if locations %}
{% for location in locations %} {% for location in locations %}