Ajout des textures du terrain de basket et de la piscine

This commit is contained in:
EpicKiwi 2026-02-15 17:46:40 +01:00
parent 251cfa9a8a
commit fd968a9305
Signed by: epickiwi
GPG key ID: C4B28FD2729941CE
16 changed files with 142 additions and 51 deletions

View file

@ -78,25 +78,15 @@ export async function init(){
})
}
const HIGHLIGHT_LAYER = Symbol("Hilight map layer")
const HIGHLIGHT_LAYER = Symbol("Highlight map layer")
const AMENITY_MARKER_LAYER = Symbol("Amenity marker layer")
const PARENT_FEATURE = Symbol("Parent feature")
const HIGHLIGHT_MARKER_ICON = L.divIcon({
className: "highlight-point-icon"
})
export async function init_places(places_db){
places = places_db
// La couche des zones disponibles
const area_highlight = L.geoJSON(null, {
style: function(feature){
return {
className: "map-hilight-area",
fill: false,
stroke: false
}
},
onEachFeature: function(feature, layer){
feature[HIGHLIGHT_LAYER] = layer
}
}).addTo(map)
// La couche des zones disponibles
const amenities = L.geoJSON(null, {
@ -139,6 +129,36 @@ export async function init_places(places_db){
return L.marker(latlng, {
icon: icon
})
},
onEachFeature: function(feature, layer){
if(feature[PARENT_FEATURE]){
feature[PARENT_FEATURE][AMENITY_MARKER_LAYER] = layer
} else {
feature[AMENITY_MARKER_LAYER] = layer
}
}
}).addTo(map)
// La couche des zones disponibles
const area_highlight = L.geoJSON(null, {
pointToLayer: function(feature, latlng) {
return L.marker(latlng, {
icon: HIGHLIGHT_MARKER_ICON
})
},
style: function(feature){
return {
className: "map-hilight-area",
fill: false,
stroke: false
}
},
onEachFeature: function(feature, layer){
if(feature[PARENT_FEATURE]){
feature[PARENT_FEATURE][HIGHLIGHT_LAYER] = layer
} else {
feature[HIGHLIGHT_LAYER] = layer
}
}
}).addTo(map)

View file

@ -189,6 +189,7 @@ export class PlaceDatabase extends EventTarget {
default_database.loadGeojson(new URL("../couches/terrain-de-basket.geojson", import.meta.url), {batch: true}),
default_database.loadGeojson(new URL("../couches/pieces-batiments.geojson", import.meta.url), {batch: true}),
default_database.loadGeojson(new URL("../couches/camping.geojson", import.meta.url), {batch: true}),
default_database.loadGeojson(new URL("../couches/eau-potable.geojson", import.meta.url), {batch: true}),
])
default_database.buildIndex()