Show OSM object type names from id-tagging-schema

This commit is contained in:
Edward Betts 2021-05-14 11:07:32 +02:00
parent ca3544126b
commit 4cfeffd878
2 changed files with 31 additions and 3 deletions

View file

@ -421,9 +421,18 @@ function mouse_events(marker, qid) {
for (const osm of nearby) {
var span_id = osm.identifier.replace("/", "_");
nearby_lookup[span_id] = osm;
osm_html += `<span class="osm-candidate" id="${span_id}"> ${osm.distance.toFixed(
1
)}m ${osm.name || "no name"}</span><br>`;
osm_html += `<span class="osm-candidate" id="${span_id}"> ${osm.distance.toFixed(1)}m `
osm_html += osm.presets.join(", ");
if (osm.presets.length && osm.name) {
osm_html += ": ";
}
if (osm.name) {
osm_html += osm.name;
}
if (!osm.presets.length && !osm.name) {
osm_html += "no name";
}
osm_html += "</span><br>";
}
candidates.innerHTML = osm_html;
var span_list = document.getElementsByClassName("osm-candidate");