mirror of
https://forge.chapril.org/tykayn/libre-charge-map
synced 2025-06-20 01:34:43 +02:00
up details binding
This commit is contained in:
parent
d34b753d53
commit
68e7dc19fc
1 changed files with 47 additions and 32 deletions
|
@ -600,9 +600,9 @@ function makePopupOfFeature(feature) {
|
|||
* @param layer
|
||||
*/
|
||||
function eachFeature(feature, layer, stats) {
|
||||
let outPowerGuessed = lcm_utils.guessOutputPowerFromFeature(feature);
|
||||
const maxPowerFilter = parseInt($('#filter_max_output').val()) || lcm_config.filter_max_output_default_value;
|
||||
|
||||
const maxPowerFilter = parseInt($('#filter_max_output').val()) || lcm_config.filter_max_output_default_value;
|
||||
let outPowerGuessed = lcm_utils.guessOutputPowerFromFeature(feature);
|
||||
// Filtrage par puissance
|
||||
if (outPowerGuessed === 0 || outPowerGuessed === null) {
|
||||
if (display_unknown_max_power_station === 'hide') {
|
||||
|
@ -618,12 +618,10 @@ function eachFeature(feature, layer, stats) {
|
|||
// Incrémenter le compteur de stations affichées
|
||||
displayedStationsCount++;
|
||||
|
||||
let link_josm = createJOSMEditLink(feature);
|
||||
|
||||
let popupContent = makePopupOfFeature(feature);
|
||||
layer.bindPopup(popupContent);
|
||||
|
||||
let displayOutPowerGuessed = '? kW';
|
||||
|
||||
// Vérifier les filtres activés
|
||||
if (lcm_config.filterCCS && !feature.properties.tags['socket:type2_combo']) {
|
||||
|
@ -670,6 +668,7 @@ function eachFeature(feature, layer, stats) {
|
|||
}
|
||||
}
|
||||
|
||||
let displayOutPowerGuessed = '? kW';
|
||||
if (outPowerGuessed) {
|
||||
displayOutPowerGuessed = outPowerGuessed + ' kW max';
|
||||
if (display_unknown_max_power_station === 'show_only') {
|
||||
|
@ -689,9 +688,6 @@ function eachFeature(feature, layer, stats) {
|
|||
<a class="edit-button" href="https://www.openstreetmap.org/edit?editor=remote&node=${feature.properties.id}">ajoutez la dans OpenStreetMap!</a></span>`;
|
||||
}
|
||||
|
||||
// Ajout du lien vers Panoramax
|
||||
const panoramaxLink = `https://api.panoramax.xyz/#focus=map&map=16.7/${feature.geometry.coordinates[1]}/${feature.geometry.coordinates[0]}&speed=250`;
|
||||
|
||||
|
||||
// contenu de la popup
|
||||
let html = `<span class="color-indication" style="background-color: ${lcm_color_utils.getColor(feature)};">${displayOutPowerGuessed}</span>
|
||||
|
@ -819,7 +815,29 @@ function eachFeature(feature, layer, stats) {
|
|||
bindFullDetails(feature);
|
||||
|
||||
// Remplir automatiquement #current_station_infos lors du clic
|
||||
fillDetailsWithFeature(feature);
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remplit le contenu de #current_station_infos avec les informations de la station
|
||||
* @param {*} feature
|
||||
*/
|
||||
function fillDetailsWithFeature(feature) {
|
||||
|
||||
|
||||
// Ajout du lien vers Panoramax
|
||||
const panoramaxLink = `https://api.panoramax.xyz/#focus=map&map=16.7/${feature.geometry.coordinates[1]}/${feature.geometry.coordinates[0]}&speed=250`;
|
||||
|
||||
|
||||
let link_josm = createJOSMEditLink(feature);
|
||||
let outPowerGuessed = lcm_utils.guessOutputPowerFromFeature(feature);
|
||||
let displayOutPowerGuessed = '? kW';
|
||||
if (outPowerGuessed) {
|
||||
displayOutPowerGuessed = outPowerGuessed + ' kW max';
|
||||
}
|
||||
let content = '';
|
||||
let table_details = '';
|
||||
let count_features_in_table = 0;
|
||||
|
@ -863,9 +881,6 @@ function eachFeature(feature, layer, stats) {
|
|||
</div>
|
||||
`
|
||||
$('#current_station_infos').html(`<div class='island irve-details'><h2>Détails</h2>${content}</div>`);
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function bindFullDetails(feature) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue