22 lines
No EOL
784 B
JavaScript
22 lines
No EOL
784 B
JavaScript
export function capaciteParkingWidget(feature){
|
||
if(feature.properties["Parking"] && feature.properties["capacite"]){
|
||
let content = document.createElement("div")
|
||
content.classList.add("widget")
|
||
content.classList.add("table-widget")
|
||
content.classList.add("capacite-parking-widget")
|
||
|
||
let fielName = document.createElement("h2");
|
||
fielName.textContent = "Capacité :"
|
||
content.append(fielName)
|
||
|
||
let value = document.createElement("p");
|
||
if(feature.properties["capacite"] > 1){
|
||
value.textContent = `${feature.properties["capacite"]} places`
|
||
} else {
|
||
value.textContent = `${feature.properties["capacite"]} place`
|
||
}
|
||
content.append(value)
|
||
|
||
return content
|
||
}
|
||
} |