Fix RMO status page to use mapbox, make selection of address fly there

This commit is contained in:
Eli Ribble 2026-03-11 15:50:12 +00:00
parent f2eda02f26
commit edcb48f84f
No known key found for this signature in database
3 changed files with 55 additions and 45 deletions

View file

@ -144,8 +144,18 @@ function onLoad() {
report_table.addEventListener("row-clicked", (e) => {
window.location = "/status/" + e.detail.reportId;
})
document.querySelector("address-or-report-input").addEventListener("suggestion-selected", maybeEnableLookupButton);
document.querySelector("address-or-report-input").addEventListener("suggestion-selected", (e) => {
maybeEnableLookupButton(e)
if (e.detail.type == "address") {
map.flyTo({
center: {
lng: e.detail.content.geometry.coordinates[0],
lat: e.detail.content.geometry.coordinates[1],
},
zoom: 15,
});
}
});
document.querySelector("address-or-report-input").addEventListener("input", maybeEnableLookupButton);
document.getElementById("lookup-form").addEventListener("submit", handleLookupFormSubmit);
}