mirror of
https://forge.chapril.org/tykayn/libre-charge-map
synced 2025-06-20 01:34:43 +02:00
checkbox filters from config
This commit is contained in:
parent
c1a76c9701
commit
b44fa95a09
3 changed files with 39 additions and 0 deletions
17
index.html
17
index.html
|
@ -118,6 +118,23 @@
|
|||
<div class="filter-group">
|
||||
qualité
|
||||
<button id="filterUnkown">❓ kW max inconnu</button>
|
||||
<div class="filter-group">
|
||||
<label>
|
||||
<input type="checkbox" id="filterCableAttached"> Prise avec câble attaché
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
<input type="checkbox" id="filterCCS"> Prise CCS
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
<input type="checkbox" id="filterType2"> Prise Type 2
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
<input type="checkbox" id="filterQuality"> Contrôle qualité
|
||||
</label>
|
||||
</div>
|
||||
<!--
|
||||
<br>
|
||||
<fieldset class="wip">
|
||||
|
|
|
@ -7,6 +7,18 @@ const lcm_config = {
|
|||
hide_osmose_markers_if_close_to_existing_charging_stations_distance: 5, // meters
|
||||
|
||||
max_possible_station_output: 400,
|
||||
// Filtres pour les prises
|
||||
filterCableAttached: false,
|
||||
filterCCS: false,
|
||||
filterType2: false,
|
||||
filterQuality: false,
|
||||
// Configuration des filtres
|
||||
filterConfigs: {
|
||||
'filterCableAttached': false,
|
||||
'filterCCS': false,
|
||||
'filterType2': false,
|
||||
'filterQuality': false
|
||||
},
|
||||
tileServers: {
|
||||
osm: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
cycle: 'https://{s}.tile.thunderforest.org/cycle/{z}/{x}/{y}.png',
|
||||
|
|
|
@ -905,6 +905,16 @@ $(document).ready(function () {
|
|||
refreshDisplay();
|
||||
});
|
||||
showActiveFilter(display_unknown_max_power_station, '#filterUnkown');
|
||||
|
||||
$('#shareUrl').on('click', copyCurrentUrl);
|
||||
|
||||
// Écouteurs pour les nouveaux filtres
|
||||
Object.keys(lcm_config.filterConfigs).forEach(filterId => {
|
||||
$(`#${filterId}`).on('change', function() {
|
||||
lcm_config[lcm_config.filterConfigs[filterId]] = this.checked;
|
||||
refreshDisplay();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function showActiveFilter(filterVariableName, selectorId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue