Ajouté quelques widgets
This commit is contained in:
parent
e61c495cc4
commit
9c5c4181b2
8 changed files with 189 additions and 35 deletions
28
js/feature-widgets/capacite-espace.js
Normal file
28
js/feature-widgets/capacite-espace.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
function exclude(feature){
|
||||
return feature.properties["Parking"] ||
|
||||
feature.properties["n couchage"];
|
||||
}
|
||||
|
||||
export function capaciteEspaceWidget(feature){
|
||||
let capacityValue = feature.properties["capacity"] || feature.properties["capacite"]
|
||||
if((capacityValue !== undefined && capacityValue !== null) && !(exclude(feature))){
|
||||
let content = document.createElement("div")
|
||||
content.classList.add("widget")
|
||||
content.classList.add("table-widget")
|
||||
content.classList.add("capacite-espace-widget")
|
||||
|
||||
let fielName = document.createElement("h2");
|
||||
fielName.textContent = "Capacité :"
|
||||
content.append(fielName)
|
||||
|
||||
let value = document.createElement("p");
|
||||
if(capacityValue > 1){
|
||||
value.textContent = `${capacityValue} personnes`
|
||||
} else {
|
||||
value.textContent = `${capacityValue} personne`
|
||||
}
|
||||
content.append(value)
|
||||
|
||||
return content
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue