28 lines
No EOL
957 B
JavaScript
28 lines
No EOL
957 B
JavaScript
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
|
||
}
|
||
} |