Show location markers for images too

This commit is contained in:
Eli Ribble 2026-01-21 21:10:21 +00:00
parent b94d09696e
commit 486a2d98c2
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View file

@ -103,7 +103,10 @@ class MapWithMarkers extends HTMLElement {
console.log("Add marker", coords, color);
const el = document.createElement("div");
el.id = "marker";
const marker = new mapboxgl.Marker().setLngLat(coords).addTo(this._map);
const marker = new mapboxgl.Marker({
color: color,
scale: 1.5,
}).setLngLat(coords).addTo(this._map);
this._markers.push(marker);
}
}

View file

@ -54,7 +54,10 @@ function onLoad() {
center: GEOJSON_LOCATION.coordinates,
zoom: 14,
});
map.addMarker(GEOJSON_LOCATION.coordinates, "#FF0000");
map.addMarker(GEOJSON_LOCATION.coordinates, "#00FF00");
GEOJSON_IMAGE_LOCATIONS.forEach((image) => {
map.addMarker(image.coordinates, "#FF0000");
});
});
}
document.addEventListener("DOMContentLoaded", onLoad);