Center map on feature when selecting feature from search results

This commit is contained in:
Bryan Housel
2015-12-20 00:33:22 -05:00
parent 7b077b48a4
commit ea1e626d41
+7
View File
@@ -223,6 +223,13 @@ iD.ui.FeatureList = function(context) {
context.map().centerZoom([d.location[1], d.location[0]], 20);
}
else if (d.entity) {
if (d.entity.type === 'node') {
context.map().center(d.entity.loc);
} else if (d.entity.type === 'way') {
var center = context.projection(context.map().center()),
edge = iD.geo.chooseEdge(context.childNodes(d.entity), center, context.projection);
context.map().center(edge.loc);
}
context.enter(iD.modes.Select(context, [d.entity.id]).suppressMenu(true));
} else {
context.zoomToEntity(d.id);