|
|
@ -2,15 +2,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
{% block main %}
|
|
|
|
<div id="home_content">
|
|
|
|
<div id="home_content">
|
|
|
|
<h1 class="header" id="title">GEO</h1>
|
|
|
|
|
|
|
|
<p id="position"></p>
|
|
|
|
<p id="position"></p>
|
|
|
|
|
|
|
|
<!-- <h1 class="header" id="title">GEO</h1> -->
|
|
|
|
<button id="store_location" onclick="store_location()">store my position</button>
|
|
|
|
<button id="store_location" onclick="store_location()">store my position</button>
|
|
|
|
<button id="add_text" onclick="add_text()">add message</button>
|
|
|
|
<button id="add_text" onclick="add_text()">add message</button>
|
|
|
|
<button id="add_audio" onclick="add_audio()">add audio</button>
|
|
|
|
<button id="add_audio" onclick="add_audio()">add audio</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- HEADING DIRECTION https://stackoverflow.com/questions/46033649/heading-javascript-geolocation -->
|
|
|
|
<!-- HEADING DIRECTION https://stackoverflow.com/questions/46033649/heading-javascript-geolocation -->
|
|
|
|
<!-- COMPAS CROSS DEVICE https://stackoverflow.com/questions/16048514/can-i-use-javascript-to-get-the-compass-heading-for-ios-and-android-->
|
|
|
|
<!-- COMPASS CROSS DEVICE https://stackoverflow.com/questions/16048514/can-i-use-javascript-to-get-the-compass-heading-for-ios-and-android-->
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock main %}
|
|
|
|
{% endblock main %}
|
|
|
|
{% block js %}
|
|
|
|
{% block js %}
|
|
|
@ -40,13 +40,35 @@
|
|
|
|
// }).addTo(map);
|
|
|
|
// }).addTo(map);
|
|
|
|
|
|
|
|
|
|
|
|
locations.forEach(function (item, index) {
|
|
|
|
locations.forEach(function (item, index) {
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
var circle = L.circle([item.latitude, item.longitude], {
|
|
|
|
if(item.loc_type=="message"){
|
|
|
|
color: 'red',
|
|
|
|
var circle = L.circle([item.latitude, item.longitude], {
|
|
|
|
fillColor: 'red',
|
|
|
|
color: 'blue',
|
|
|
|
fillOpacity: 1,
|
|
|
|
stroke:false,
|
|
|
|
radius: 30
|
|
|
|
fillColor: 'blue',
|
|
|
|
}).addTo(map);
|
|
|
|
fillOpacity: 1,
|
|
|
|
|
|
|
|
radius: 15
|
|
|
|
|
|
|
|
}).addTo(map).on("click", circleClick);;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(item.loc_type=="audio"){
|
|
|
|
|
|
|
|
var circle = L.circle([item.latitude, item.longitude], {
|
|
|
|
|
|
|
|
color: 'green',
|
|
|
|
|
|
|
|
stroke:false,
|
|
|
|
|
|
|
|
fillColor: 'green',
|
|
|
|
|
|
|
|
fillOpacity: 0.5,
|
|
|
|
|
|
|
|
radius: 15
|
|
|
|
|
|
|
|
}).addTo(map).on("click", circleClick);;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
var circle = L.circle([item.latitude, item.longitude], {
|
|
|
|
|
|
|
|
color: 'black',
|
|
|
|
|
|
|
|
stroke:false,
|
|
|
|
|
|
|
|
fillColor: 'black',
|
|
|
|
|
|
|
|
fillOpacity: 0.5,
|
|
|
|
|
|
|
|
radius: 30
|
|
|
|
|
|
|
|
}).addTo(map).on("click", circleClick);;
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
console.error(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -55,9 +77,10 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var myPositionCircle = L.circle([48.172934, 9.01236], {
|
|
|
|
var myPositionCircle = L.circle([48.172934, 9.01236], {
|
|
|
|
color: 'black',
|
|
|
|
color: 'red',
|
|
|
|
fillColor: 'black',
|
|
|
|
stroke:false,
|
|
|
|
fillOpacity: 1,
|
|
|
|
fillColor: 'red',
|
|
|
|
|
|
|
|
fillOpacity: 0.5,
|
|
|
|
radius: 30
|
|
|
|
radius: 30
|
|
|
|
}).addTo(map);
|
|
|
|
}).addTo(map);
|
|
|
|
|
|
|
|
|
|
|
|