Sort handles, fix area closing

This commit is contained in:
Tom MacWright
2012-12-04 17:40:37 -05:00
parent ea02651ed9
commit cdacdca2af
2 changed files with 8 additions and 5 deletions

View File

@@ -41,8 +41,6 @@ iD.modes.AddPlace = {
}
};
// user has clicked 'add road' or pressed a keybinding, and now has
// a teaser node and needs to click on the map to start a road
iD.modes.AddRoad = {
id: 'add-road',
title: '+ Road',

View File

@@ -206,14 +206,19 @@ iD.Map = function() {
var handles = g.hit.selectAll('image.handle')
.filter(filter)
.data(waynodes, key);
function olderOnTop(a, b) {
return (+a.id.slice(1)) - (+b.id.slice(1));
}
handles.exit().remove();
handles.enter().append('image')
.attr({ width: 6, height: 6, 'class': 'handle', 'xlink:href': 'css/handle.png' })
.call(dragbehavior);
handles.attr('transform', function(entity) {
var p = projection(ll2a(entity));
return 'translate(' + [~~p[0], ~~p[1]] + ') translate(-3, -3) rotate(45, 3, 3)';
}).classed('active', classActive);
var p = projection(ll2a(entity));
return 'translate(' + [~~p[0], ~~p[1]] + ') translate(-3, -3) rotate(45, 3, 3)';
})
.classed('active', classActive)
.sort(olderOnTop);
}
function drawAccuracyHandles(waynodes) {