diff --git a/.DS_Store b/.DS_Store index d15ee60..15f21ef 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/.DS_Store b/app/.DS_Store index e75e3e6..d0a3c6a 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/app/static/.DS_Store b/app/static/.DS_Store new file mode 100644 index 0000000..1bc7932 Binary files /dev/null and b/app/static/.DS_Store differ diff --git a/app/static/css/style.css b/app/static/css/style.css index 2ebbee7..0896e25 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -255,10 +255,14 @@ margin: 4em 0; } #button_group button, #button_group select{ - background-color: black; + background-color: grey; color: white; font-size: 1em; border: 1px solid white; border-radius: 2em; padding: 0.8em; +} + +#button_group img{ + width: 1em; } \ No newline at end of file diff --git a/app/static/img/audio.png b/app/static/img/audio.png new file mode 100644 index 0000000..61ee4d6 Binary files /dev/null and b/app/static/img/audio.png differ diff --git a/app/static/img/hangout.png b/app/static/img/hangout.png new file mode 100644 index 0000000..420bada Binary files /dev/null and b/app/static/img/hangout.png differ diff --git a/app/static/img/me.png b/app/static/img/me.png new file mode 100644 index 0000000..87470da Binary files /dev/null and b/app/static/img/me.png differ diff --git a/app/static/img/mosquito.png b/app/static/img/mosquito.png new file mode 100644 index 0000000..dec7252 Binary files /dev/null and b/app/static/img/mosquito.png differ diff --git a/app/static/img/text.png b/app/static/img/text.png new file mode 100644 index 0000000..4104db8 Binary files /dev/null and b/app/static/img/text.png differ diff --git a/app/templates/home.html b/app/templates/home.html index e678435..2b31bc4 100755 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -5,14 +5,15 @@

- - - + + + +
@@ -75,53 +76,62 @@ locations.forEach(function (item, index) { try { + var icon; if(item.loc_type=="message"){ - var circle = L.circle([item.latitude, item.longitude], { - color: 'blue', - stroke:false, - fillColor: 'blue', - fillOpacity: 1, - radius: 10 - }).addTo(map).on("click", e => circleClick(e)); - circle.id = item.id; - circleArray.push(circle); + icon = L.icon({ + iconUrl: '/static/img/text.png', + iconSize: [50, 50], + iconAnchor: [25, 25], + popupAnchor: [-3, -76], + }); + } else if(item.loc_type=="audio"){ - var circle = L.circle([item.latitude, item.longitude], { - color: 'green', - stroke:false, - fillColor: 'green', - fillOpacity: 0.5, - radius: 10 - }).addTo(map).on("click", e => circleClick(e)); - circle.id = item.id; - circleArray.push(circle); + icon = L.icon({ + iconUrl: '/static/img/audio.png', + iconSize: [50, 50], + iconAnchor: [25, 25], + popupAnchor: [-3, -76], + }); } else{ - var circle = L.circle([item.latitude, item.longitude], { - color: 'black', - stroke:false, - fillColor: 'black', - fillOpacity: 0.5, - radius: 10 - }).addTo(map).on("click", e => circleClick(e)); - circle.id = item.id; - circleArray.push(circle); + icon = L.icon({ + iconUrl: '/static/img/mosquito.png', + iconSize: [50, 50], + iconAnchor: [25, 25], + popupAnchor: [-3, -76], + }); + } + var circle = L.marker([item.latitude, item.longitude], {icon: icon}).addTo(map).on("click", e => circleClick(e)); + circle.id = item.id; + circleArray.push(circle); + markerArray.push(L.marker([item.latitude, item.longitude])); } catch (error) { - console.error(error); + console.error(error); } }); - var myPositionCircle = L.circle([48.172934, 9.01236], { - color: 'red', - stroke:false, - fillColor: 'red', - fillOpacity: 0.5, - radius: 10 - }).addTo(map); + // var myPositionCircle = L.circle([48.172934, 9.01236], { + // color: 'red', + // stroke:false, + // fillColor: 'red', + // fillOpacity: 0.5, + // radius: 10 + // }).addTo(map); + + var myIcon = L.icon({ + iconUrl: '/static/img/me.png', + iconSize: [50, 50], + iconAnchor: [50, 50], + popupAnchor: [-3, -76], + }); + + var myPositionCircle = L.marker([50.505, 30.57], {icon: myIcon}).addTo(map); + circleArray.push(myPositionCircle); + var x = document.getElementById("position"); @@ -151,7 +161,7 @@ x.innerHTML = "Latitude: " + crd.latitude + "
Longitude: " + crd.longitude + - "
Distance to tent: " + distance(target.longitude, target.latitude, crd.longitude, crd.latitude); + "
Distance to TENT: " + distance(target.longitude, target.latitude, crd.longitude, crd.latitude); // if we want to clear the watch // if (target.latitude === crd.latitude && target.longitude === crd.longitude) { @@ -227,12 +237,12 @@ myPositionCircle.setLatLng([my_location.latitude, my_location.longitude]); if(view == "all"){ var group = new L.featureGroup(circleArray); - map.fitBounds(group.getBounds().pad(0.1)); + map.fitBounds(group.getBounds().pad(0.4)); } else if(view = "closest"){ var closest = L.GeometryUtil.closestLayer(map, markerArray, myPositionCircle.getLatLng()); var group = new L.featureGroup([closest.layer, myPositionCircle]); - map.fitBounds(group.getBounds().pad(0.1)); + map.fitBounds(group.getBounds().pad(0.4)); } }