Ajout des dortoirs
This commit is contained in:
parent
fd968a9305
commit
81bfc6d858
1 changed files with 15 additions and 2 deletions
17
js/map.js
17
js/map.js
|
|
@ -121,6 +121,15 @@ export async function init_places(places_db){
|
|||
iconEl.append(shower_icon)
|
||||
}
|
||||
|
||||
if(feature.properties["n couchage"]){
|
||||
let dorm_icon = document.createElement("img")
|
||||
dorm_icon.src = new URL("../icons/dortoir.svg", import.meta.url).toString()
|
||||
dorm_icon.alt = "Icone de dortoir"
|
||||
dorm_icon.title = "Dortoir"
|
||||
dorm_icon.classList.add("dorm")
|
||||
iconEl.append(dorm_icon)
|
||||
}
|
||||
|
||||
let icon = L.divIcon({
|
||||
className: "map-amenity-icon",
|
||||
html: iconEl
|
||||
|
|
@ -166,11 +175,15 @@ export async function init_places(places_db){
|
|||
for(let [_feature_id, feature] of Object.entries(places.featuresById)){
|
||||
area_highlight.addData(feature)
|
||||
|
||||
if(feature.properties["toilettes"] || feature.properties["douches"] || feature.properties["eau potable"]) {
|
||||
if(feature.properties["toilettes"]
|
||||
|| feature.properties["douches"]
|
||||
|| feature.properties["eau potable"]
|
||||
|| feature.properties["n couchage"]
|
||||
) {
|
||||
let amenity_feature
|
||||
|
||||
if(feature.geometry.type != "Point"){
|
||||
amenity_feature = turf.centroid(feature)
|
||||
amenity_feature = turf.centerOfMass(feature)
|
||||
amenity_feature[PARENT_FEATURE] = feature
|
||||
amenity_feature.properties = feature.properties
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue