Show location markers for images too
This commit is contained in:
parent
b94d09696e
commit
486a2d98c2
2 changed files with 8 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue