22 lines
No EOL
755 B
JavaScript
22 lines
No EOL
755 B
JavaScript
export function capaciteDortoirWidget(feature){
|
||
if(feature.properties["n couchage"]){
|
||
let content = document.createElement("div")
|
||
content.classList.add("widget")
|
||
content.classList.add("table-widget")
|
||
content.classList.add("capacite-dortoir-widget")
|
||
|
||
let fielName = document.createElement("h2");
|
||
fielName.textContent = "Capacité :"
|
||
content.append(fielName)
|
||
|
||
let value = document.createElement("p");
|
||
if(feature.properties["n couchage"] > 1){
|
||
value.textContent = `${feature.properties["n couchage"]} lits`
|
||
} else {
|
||
value.textContent = `${feature.properties["n couchage"]} lit`
|
||
}
|
||
content.append(value)
|
||
|
||
return content
|
||
}
|
||
} |