-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable way segments toolbar item and basic orthogonal drawing support (…
…close #6453)
- Loading branch information
1 parent
da81fb3
commit 4210435
Showing
11 changed files
with
162 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { | ||
select as d3_select | ||
} from 'd3-selection'; | ||
|
||
import { svgIcon } from '../../svg'; | ||
import { t } from '../../util/locale'; | ||
|
||
export function uiToolWaySegments(context) { | ||
|
||
var tool = { | ||
id: 'way_segments', | ||
contentClass: 'joined', | ||
label: t('toolbar.segments.title') | ||
}; | ||
|
||
tool.render = function(selection) { | ||
|
||
var waySegmentTypes = [ | ||
{ | ||
id: 'straight' | ||
}, | ||
{ | ||
id: 'orthogonal' | ||
} | ||
]; | ||
|
||
var buttons = selection.selectAll('.bar-button') | ||
.data(waySegmentTypes) | ||
.enter(); | ||
|
||
buttons | ||
.append('button') | ||
.attr('class', function(d) { | ||
var segmentType = context.storage('line-segments') || 'straight'; | ||
return 'bar-button ' + (segmentType === d.id ? 'active' : ''); | ||
}) | ||
.attr('tabindex', -1) | ||
.on('click', function(d) { | ||
if (d3_select(this).classed('active')) return; | ||
|
||
context.storage('line-segments', d.id); | ||
|
||
selection.selectAll('.bar-button') | ||
.classed('active', false); | ||
d3_select(this).classed('active', true); | ||
}) | ||
.each(function(d) { | ||
d3_select(this).call(svgIcon('#iD-segment-' + d.id, 'icon-30')); | ||
}); | ||
}; | ||
|
||
tool.update = function() { | ||
|
||
}; | ||
|
||
tool.uninstall = function() { | ||
|
||
}; | ||
|
||
return tool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.