|
|
|
@ -2,15 +2,15 @@
|
|
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
|
<div id="home_content">
|
|
|
|
|
<h1 class="header" id="title">GEO</h1>
|
|
|
|
|
<p id="position"></p>
|
|
|
|
|
<!-- <h1 class="header" id="title">GEO</h1> -->
|
|
|
|
|
<button id="store_location" onclick="store_location()">store my position</button>
|
|
|
|
|
<button id="add_text" onclick="add_text()">add message</button>
|
|
|
|
|
<button id="add_audio" onclick="add_audio()">add audio</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 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 %}
|
|
|
|
|
{% block js %}
|
|
|
|
@ -40,13 +40,35 @@
|
|
|
|
|
// }).addTo(map);
|
|
|
|
|
|
|
|
|
|
locations.forEach(function (item, index) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
var circle = L.circle([item.latitude, item.longitude], {
|
|
|
|
|
color: 'red',
|
|
|
|
|
fillColor: 'red',
|
|
|
|
|
fillOpacity: 1,
|
|
|
|
|
radius: 30
|
|
|
|
|
}).addTo(map);
|
|
|
|
|
if(item.loc_type=="message"){
|
|
|
|
|
var circle = L.circle([item.latitude, item.longitude], {
|
|
|
|
|
color: 'blue',
|
|
|
|
|
stroke:false,
|
|
|
|
|
fillColor: 'blue',
|
|
|
|
|
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) {
|
|
|
|
|
console.error(error);
|
|
|
|
|
}
|
|
|
|
@ -55,9 +77,10 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var myPositionCircle = L.circle([48.172934, 9.01236], {
|
|
|
|
|
color: 'black',
|
|
|
|
|
fillColor: 'black',
|
|
|
|
|
fillOpacity: 1,
|
|
|
|
|
color: 'red',
|
|
|
|
|
stroke:false,
|
|
|
|
|
fillColor: 'red',
|
|
|
|
|
fillOpacity: 0.5,
|
|
|
|
|
radius: 30
|
|
|
|
|
}).addTo(map);
|
|
|
|
|
|
|
|
|
|