Fix JS error when zooming to lat/lon values coded in search bar (close #7670)

This commit is contained in:
Quincy Morgan
2020-06-05 12:06:21 -04:00
parent 4e0495d6c5
commit 3506389d83
+8 -4
View File
@@ -327,6 +327,8 @@ export function uiFeatureList(context) {
function mouseout(d) {
if (d.id === -1) return;
utilHighlightEntities([d.id], false, context);
}
@@ -334,12 +336,12 @@ export function uiFeatureList(context) {
function click(d) {
d3_event.preventDefault();
utilHighlightEntities([d.id], false, context);
if (d.location) {
context.map().centerZoomEase([d.location[1], d.location[0]], 19);
}
else if (d.entity) {
} else if (d.entity) {
utilHighlightEntities([d.id], false, context);
if (d.entity.type === 'node') {
context.map().center(d.entity.loc);
} else if (d.entity.type === 'way') {
@@ -348,7 +350,9 @@ export function uiFeatureList(context) {
context.map().center(edge.loc);
}
context.enter(modeSelect(context, [d.entity.id]));
} else {
// download, zoom to, and select the entity with the given ID
context.zoomToEntity(d.id);
}
}