minor changes to home

geo
Alexander Roidl 2 years ago
parent 60ac20d90d
commit fd3564f1f7

Binary file not shown.

@ -63,8 +63,7 @@ audio{
} }
.locations_list .row div:last-of-type{ .locations_list .row div:last-of-type{
width: 10%;
min-width: 3rem;
} }
.locations_list .row div{ .locations_list .row div{

@ -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);

@ -65,8 +65,6 @@ def list_locations():
return render_template('list.html',domain=DOMAIN, locations = locations, data_locations = serialized) return render_template('list.html',domain=DOMAIN, locations = locations, data_locations = serialized)
@app.route('/hello/<name>') @app.route('/hello/<name>')
def hello(name): def hello(name):
return "Hello " + name return "Hello " + name

Loading…
Cancel
Save