mirror of
https://forge.chapril.org/tykayn/libre-charge-map
synced 2025-06-20 01:34:43 +02:00
icons in socket filter
This commit is contained in:
parent
bb917dfd31
commit
217416234a
10 changed files with 576 additions and 125 deletions
|
@ -243,7 +243,7 @@ function updateURLWithMapCoordinatesAndZoom() {
|
|||
}
|
||||
|
||||
|
||||
let all_stations_markers = L.layerGroup().addTo(map) // layer group pour tous les marqueurs
|
||||
let all_stations_markers = L.layerGroup() // layer group pour tous les marqueurs
|
||||
// let stations_much_speed_wow = L.layerGroup().addTo(map) // layer group des stations rapides
|
||||
|
||||
var osm = L.tileLayer(lcm_config.tileServers.osm, {
|
||||
|
@ -285,11 +285,11 @@ var baseLayers = {
|
|||
// 'OpenCycleMap': cycle,
|
||||
'Transport': transport
|
||||
}
|
||||
let overlays = {
|
||||
stations: all_stations_markers
|
||||
}
|
||||
// let overlays = {
|
||||
// stations: all_stations_markers
|
||||
// }
|
||||
|
||||
const layerControl = L.control.layers(baseLayers, overlays, { collapsed: true }).addTo(map)
|
||||
// const layerControl = L.control.layers(baseLayers, overlays, { collapsed: true }).addTo(map)
|
||||
tileGrey.addTo(map)
|
||||
|
||||
|
||||
|
@ -479,7 +479,8 @@ function displayStatsFromGeoJson(resultAsGeojson, stats) {
|
|||
// Ajouter une fonction pour mettre à jour les compteurs
|
||||
function updateCounters() {
|
||||
const stationsCount = geojsondata ? geojsondata.features.length : 0;
|
||||
const osmoseText = osmoseIssuesCount > 0 ? ` <span class="osmose-counter">(+ ${osmoseIssuesCount} ?)</span>` : '';
|
||||
console.log("osmoseIssuesList", lcm_config.osmoseIssuesList);
|
||||
const osmoseText = lcm_config.osmoseIssuesList.length > 0 ? ` <span class="osmose-counter">(+ ${lcm_config.osmoseIssuesList.length} ?)</span>` : '';
|
||||
$('#count_features_fond').html(`⚡${stationsCount}${osmoseText} stations`);
|
||||
}
|
||||
|
||||
|
@ -670,9 +671,9 @@ function eachFeature(feature, layer, stats) {
|
|||
if (lcm_config.filterQuality) {
|
||||
// Vérifier si les informations minimales de qualité sont présentes
|
||||
let hasQualityInfo = feature.properties.tags['operator'] ||
|
||||
feature.properties.tags['authentication:none'] ||
|
||||
feature.properties.tags['payment:none'] ||
|
||||
feature.properties.tags['opening_hours'];
|
||||
feature.properties.tags['authentication:none'] ||
|
||||
feature.properties.tags['payment:none'] ||
|
||||
feature.properties.tags['opening_hours'];
|
||||
if (!hasQualityInfo) {
|
||||
stats.count_hidden_by_filters++;
|
||||
return;
|
||||
|
@ -1122,8 +1123,8 @@ function searchOsmoseIssues(map) {
|
|||
return;
|
||||
}
|
||||
const issuesList = data.issues;
|
||||
lcm_config.osmoseIssuesList = [];
|
||||
osmoseIssuesCount = issuesList.length;
|
||||
console.log(`Nombre d'issues Osmose (liste) trouvées: ${osmoseIssuesCount}`);
|
||||
|
||||
issuesList.forEach(issueInfo => {
|
||||
if (issueInfo.lat == null || issueInfo.lon == null || !issueInfo.id) {
|
||||
|
@ -1146,6 +1147,8 @@ function searchOsmoseIssues(map) {
|
|||
}
|
||||
}
|
||||
|
||||
lcm_config.osmoseIssuesList.push(issueInfo);
|
||||
|
||||
// Créer le marqueur Osmose si il n'est pas trop proche d'une station existante
|
||||
const osmoseMarker = L.circle([lat, lon], {
|
||||
color: "purple",
|
||||
|
@ -1307,39 +1310,34 @@ function init() {
|
|||
|
||||
// Initialisation des états des checkboxes des filtres selon les valeurs de configuration
|
||||
Object.keys(lcm_config.filterConfigs).forEach(filterId => {
|
||||
console.log("checbox ", $(`#${filterId}`) , lcm_config.filterConfigs[filterId] , lcm_config)
|
||||
console.log("checbox ", $(`#${filterId}`), lcm_config.filterConfigs[filterId], lcm_config)
|
||||
$(`#${filterId}`).prop('checked', lcm_config.filterConfigs[filterId]);
|
||||
});
|
||||
// Écouteurs pour les filtres
|
||||
Object.keys(lcm_config.filterConfigs).forEach(filterId => {
|
||||
$(`#${filterId}`).on('change', function() {
|
||||
$(`#${filterId}`).on('change', function () {
|
||||
lcm_config[lcm_config.filterConfigs[filterId]] = this.checked;
|
||||
refreshDisplay();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
food_places_markers.addTo(map);
|
||||
$('#found_charging_stations').hide();
|
||||
// food_places_markers.addTo(map);
|
||||
|
||||
// Mettre à jour le contrôle des calques
|
||||
const overlayMaps = {
|
||||
// ...baseLayers,
|
||||
"Stations de recharge": all_stations_markers,
|
||||
"Restaurants et cafés": food_places_markers,
|
||||
"Bornes potentielles (Osmose)": osmose_markers
|
||||
};
|
||||
|
||||
// const baseLayersControl = L.control.layers(baseLayers, null, {
|
||||
// collapsed: true,
|
||||
// className: 'leaflet-control-layers base-layers',
|
||||
// id: 'base-layers-control'
|
||||
// }).addTo(map);
|
||||
|
||||
const overlayControl = L.control.layers(null, overlayMaps, {
|
||||
collapsed: true,
|
||||
const overlayControl = L.control.layers(baseLayers, overlayMaps, {
|
||||
// collapsed: false,
|
||||
className: 'leaflet-control-layers overlay-layers',
|
||||
id: 'overlay-layers-control'
|
||||
}).addTo(map);
|
||||
})
|
||||
.addTo(map);
|
||||
|
||||
$('#sendToJOSM').on('click', () => {
|
||||
sendToJOSM(map, geojsondata)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue