location test
This commit is contained in:
parent
b309669ccb
commit
a513750a86
@ -10,6 +10,8 @@
|
|||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', loadData);
|
document.addEventListener('DOMContentLoaded', loadData);
|
||||||
document.addEventListener('DOMContentLoaded', resizeMap);
|
document.addEventListener('DOMContentLoaded', resizeMap);
|
||||||
|
getPos();
|
||||||
|
|
||||||
window.onresize = resizeMap;
|
window.onresize = resizeMap;
|
||||||
|
|
||||||
function loadData() {
|
function loadData() {
|
||||||
@ -44,7 +46,18 @@
|
|||||||
function resizeMap() {
|
function resizeMap() {
|
||||||
var height = window.innerHeight
|
var height = window.innerHeight
|
||||||
document.getElementById('map').style.height = height + 'px'
|
document.getElementById('map').style.height = height + 'px'
|
||||||
console.log(height)
|
}
|
||||||
|
|
||||||
|
function getPos() {
|
||||||
|
if (navigator.geolocation) {
|
||||||
|
navigator.geolocation.getCurrentPosition(function (position) {
|
||||||
|
console.log(position)
|
||||||
|
}, function () {
|
||||||
|
console.log('no pos')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('map').innerHTML('Geolocation not available')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user