Einige Anpassungen am Dashboard. Region Ansicht.

This commit is contained in:
Giò Diani committed 2025-01-13 17:06:54 +01:00
1 parent a3121bf58e
commit ebcd647a2f
9 files changed
+306 -67

No files matched your search

+34 -3
View File
@@ -32,6 +32,14 @@
</header>
<div id="chart-calendar"></div>
</article>
<article class="header map" style="grid-area: chart5;">
<header>
<h2 id="belegung-title">
Kurzzeitmietobjekte in der Nähe
</h2>
</header>
<div id="chart-map"></div>
</article>
<article class="header" style="grid-area: chart3;">
<header>
<h2>
@@ -80,7 +88,7 @@ const cTimelineOptions = {
label: {
show: false
}
}
},
};
cTimeline.setOption(cTimelineOptions);
@@ -168,6 +176,7 @@ const chartCapacity = document.getElementById('chart-capacity');
const cCapacity = echarts.init(chartCapacity);
const cCapacityOptions = {
color: ['#9ecae1','#6baed6','#4292c6','#2171b5','#084594'],
legend: {
data: ['Auslastung Property', 'Auslastung {{ $base['region_name'] }}', 'Auslastung alle Regionen']
},
@@ -176,7 +185,7 @@ const cCapacityOptions = {
valueFormatter: (value) => value.toFixed(2)+' %'
},
grid: {
top: 20,
top: 40,
left: 25,
right: 10,
bottom: 20,
@@ -348,6 +357,29 @@ cTimeline.on('timelinechanged', (e) => {
})
/* Map w/ neighbours*/
const map = L.map('chart-map');
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
function icon(id = 0){
return L.divIcon({
className: "region"+id,
html: '<span></span>'
})
}
const markers = L.featureGroup([
@foreach($neighbours as $n)
L.marker([{{ $n['lat'] }}, {{ $n['lon'] }}], {icon: icon()}).bindPopup('<a href="/property/{{ $n['id'] }}">{{ $n['lat'] }}, {{ $n['lon'] }}</a>'),
@endforeach
]).addTo(map);
map.fitBounds(markers.getBounds(), {padding: [20,20]})
cCapacity.on('click', 'series', (e) => {
// Switch to correct calendar in the timeline
@@ -356,7 +388,6 @@ cCapacity.on('click', 'series', (e) => {
currentIndex: e.dataIndex
});
});