up emoji on demo map

This commit is contained in:
Tykayn 2025-09-27 00:39:18 +02:00 committed by tykayn
parent 65956ff6be
commit dea71fc6b3
7 changed files with 565 additions and 35 deletions

View file

@ -297,6 +297,7 @@ class DemoMainResource:
<p><a href="/demo/traffic" class="add-event-btn" style="display: block; text-align: center; margin-top: 15px; padding: 8px; background-color: #0078ff; color: white; border-radius: 4px; font-weight: bold;">+ Traffic event</a></p>
<p><a href="/demo/add" class="add-event-btn" style="display: block; text-align: center; margin-top: 15px; padding: 8px; background-color: #0078ff; color: white; border-radius: 4px; font-weight: bold;">+ Any Event</a></p>
<p><a href="/demo/live" class="live-event-btn" style="display: block; text-align: center; margin-top: 15px; padding: 8px; background-color: #0078ff; color: white; border-radius: 4px; font-weight: bold;"> Live</a></p>
<p><a href="/demo/property-stats" class="stats-event-btn" style="display: block; text-align: center; margin-top: 15px; padding: 8px; background-color: #28a745; color: white; border-radius: 4px; font-weight: bold;">📊 Statistiques propriétés</a></p>
@ -304,7 +305,7 @@ class DemoMainResource:
<br/>
<br/>
<!-- Filtres pour les événements -->
<div class="event-filters" id="filters_panel" style="margin-top: 15px; padding: 10px; background-color: #f5f5f5; border-radius: 4px; display:none;">
<div class="event-filters" id="filters_panel" style="margin-top: 15px; padding: 10px; background-color: #f5f5f5; border-radius: 4px;">
<h3 id="filters_header" style="margin-top: 0; color: #0078ff; cursor:pointer;">Filtres</h3>
<div style="margin-top: 10px;">
<label style="display: block; margin-bottom: 5px;">Type d'événement:</label>
@ -317,14 +318,14 @@ class DemoMainResource:
</select>
</div>
<div style="margin-top:12px; display:flex; align-items:center; gap:8px;">
<input type="checkbox" id="autoRefreshToggle" checked>
<label for="autoRefreshToggle" style="margin:0;">Rafraîchissement automatique (30s)</label>
</div>
</div>
<div class="event-filters" style="margin-top: 10px; padding: 10px; background-color: #fff; border: 1px solid #e5e7eb; border-radius: 4px;">
<h3 style="margin-top: 0; color: #0078ff;">Histogramme des évènements</h3>
<div style="margin-top:12px; display:flex; align-items:center; gap:8px;">
<input type="checkbox" id="autoRefreshToggle" checked>
<label for="autoRefreshToggle" style="margin:0;">Rafraîchissement automatique (30s)</label>
</div>
<canvas id="eventsHistogram" style="width:100%; height:220px;"></canvas>
</div>
@ -364,6 +365,28 @@ class DemoMainResource:
criteria: (name, description, what) => {
return (what || '').toLowerCase().includes('bike');
}
},
// Emoji casque de chantier pour les travaux
construction: {
emoji: '⛑️',
criteria: (name, description, what) => {
const text = (name + ' ' + description + ' ' + what).toLowerCase();
return text.includes('travaux');
}
},
// Emoji soleil pour les types contenant "daylight"
daylight: {
emoji: '☀️',
criteria: (name, description, what) => {
return (what || '').toLowerCase().includes('daylight');
}
},
// Emoji carte pour les types contenant "community.osm"
osm_community: {
emoji: '🗺️',
criteria: (name, description, what) => {
return (what || '').toLowerCase().includes('community.osm');
}
}
};