add position view
This commit is contained in:
parent
c178976fcf
commit
674ecde707
@ -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'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,13 +7,14 @@
|
|||||||
<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 %}
|
||||||
<div class="col-12 p-1">
|
<div class="col-12 p-1">
|
||||||
<div class="p-2 border border-dark rounded-3 border border-dark rounded bg-light text-dark">
|
<div class="p-2 border border-dark rounded-3 border border-dark rounded bg-light text-dark">
|
||||||
<a class="connection" href="">{{ location.name }}</a>
|
<a class="connection" href="">{{ location.name }}</a>
|
||||||
<p class="destination" hidden>{{ location.coords}}</p>
|
<p class="destination" hidden>{{ location.coords }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user