diff --git a/js/map.js b/js/map.js index 4f162ad..0a9a5d3 100644 --- a/js/map.js +++ b/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 {