Fix RMO status page to use mapbox, make selection of address fly there
This commit is contained in:
parent
f2eda02f26
commit
edcb48f84f
3 changed files with 55 additions and 45 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue