Zoom when an address is provided or the map is clicked

This commit is contained in:
Eli Ribble 2026-04-03 20:29:30 +00:00
parent c5c78a2b84
commit 07e48aa071
No known key found for this signature in database
2 changed files with 32 additions and 12 deletions

View file

@ -533,11 +533,35 @@ const markers = computed((): Marker[] => {
});
function doAddressSelected(address: Address) {
console.log("Address selected", address);
const geom = address.geometry;
if (!geom) {
console.error("No geometry on address", address);
return;
}
marker.value = {
color: "#FF0000",
draggable: true,
id: "x",
location: {
lat: geom.coordinates[1],
lng: geom.coordinates[0],
},
};
}
function doMapClick(location: Location) {
console.log("Map clicked", location);
marker.value = {
color: "#FF0000",
draggable: true,
id: "x",
location: location,
};
}
function doMapMarkerDragEnd(location: Location) {
console.log("marker drag end", location);
marker.value = {
color: "#FF0000",
draggable: true,
id: "x",
location: location,
};
}
</script>