Merge remote-tracking branch 'upstream/master' into unify

This commit is contained in:
SilentSpike
2019-02-04 17:17:17 +00:00
12 changed files with 132 additions and 67 deletions
+3 -1
View File
@@ -59,7 +59,9 @@ module.exports = function buildData() {
};
// Font Awesome icons used
var faIcons = {};
var faIcons = {
'fas-long-arrow-alt-right': {}
};
// Start clean
shell.rm('-f', [
-1
View File
@@ -31,7 +31,6 @@ path.stroke.tag-leisure-track,
path.stroke.tag-leisure-golf_course,
path.stroke.tag-leisure-garden,
path.stroke.tag-leisure-park,
path.stroke.tag-barrier-hedge,
path.stroke.tag-landuse-forest,
path.stroke.tag-landuse-wood,
path.stroke.tag-landuse-grass {
+76 -48
View File
@@ -1,4 +1,56 @@
/* narrow width miscellanous things */
path.line.shadow.tag-aerialway,
path.line.shadow.tag-attraction-summer_toboggan,
path.line.shadow.tag-attraction-water_slide,
path.line.shadow.tag-man_made-pipeline,
path.line.shadow.tag-natural-tree_row,
path.line.shadow.tag-piste {
stroke-width: 16;
}
path.line.casing.tag-aerialway,
path.line.casing.tag-attraction-summer_toboggan,
path.line.casing.tag-attraction-water_slide,
path.line.casing.tag-man_made-pipeline,
path.line.casing.tag-natural-tree_row,
path.line.casing.tag-piste {
stroke-width: 7;
}
path.line.stroke.tag-aerialway,
path.line.stroke.tag-attraction-summer_toboggan,
path.line.stroke.tag-attraction-water_slide,
path.line.stroke.tag-man_made-pipeline,
path.line.stroke.tag-natural-tree_row,
path.line.stroke.tag-piste {
stroke-width: 5;
}
.low-zoom path.line.shadow.tag-aerialway,
.low-zoom path.line.shadow.tag-attraction-summer_toboggan,
.low-zoom path.line.shadow.tag-attraction-water_slide,
.low-zoom path.line.shadow.tag-man_made-pipeline,
.low-zoom path.line.shadow.tag-natural-tree_row,
.low-zoom path.line.shadow.tag-piste {
stroke-width: 12;
}
.low-zoom path.line.casing.tag-aerialway,
.low-zoom path.line.casing.tag-attraction-summer_toboggan,
.low-zoom path.line.casing.tag-attraction-water_slide,
.low-zoom path.line.casing.tag-man_made-pipeline,
.low-zoom path.line.casing.tag-natural-tree_row,
.low-zoom path.line.casing.tag-piste {
stroke-width: 5;
}
.low-zoom path.line.stroke.tag-aerialway,
.low-zoom path.line.stroke.tag-attraction-summer_toboggan,
.low-zoom path.line.stroke.tag-attraction-water_slide,
.low-zoom path.line.stroke.tag-man_made-pipeline,
.low-zoom path.line.stroke.tag-natural-tree_row,
.low-zoom path.line.stroke.tag-piste {
stroke-width: 3;
}
/* ferry routes */
.preset-icon .icon.tag-route-ferry {
color: #58a9ed;
@@ -24,6 +76,22 @@ path.line.stroke.tag-route-ferry {
}
/* aerialways */
path.line.stroke.tag-aerialway {
stroke: #c55;
}
path.line.casing.tag-aerialway {
stroke: #444;
}
/* pistes */
path.line.stroke.tag-piste {
stroke: #9ac;
}
path.line.casing.tag-piste {
stroke: #444;
}
/* power and pipeline */
.preset-icon .icon.tag-man_made-pipeline,
.preset-icon .icon.tag-power {
@@ -31,6 +99,7 @@ path.line.stroke.tag-route-ferry {
fill: #939393;
}
/* power */
path.line.stroke.tag-power {
stroke: #939393;
@@ -40,21 +109,21 @@ path.line.casing.tag-power {
stroke: none;
}
/* pipeline */
path.line.stroke.tag-man_made-pipeline {
stroke: #cbd0d8;
stroke-linecap: butt;
stroke-width: 3;
stroke-dasharray: 80, 1.25;
}
path.line.casing.tag-man_made-pipeline {
stroke: #666;
stroke-width: 4.5;
}
.low-zoom path.line.stroke.tag-man_made-pipeline {
stroke-dasharray: 40, 1;
}
/* boundaries */
path.line.stroke.tag-boundary {
stroke: #fff;
@@ -73,31 +142,14 @@ path.line.casing.tag-boundary-national_park {
}
/* Tree Rows */
path.line.shadow.tag-natural-tree_row {
stroke-width: 16;
}
path.line.casing.tag-natural-tree_row {
stroke-width: 7;
}
path.line.stroke.tag-natural-tree_row {
stroke-width: 5;
}
.low-zoom path.line.shadow.tag-natural-tree_row {
stroke-width: 12;
}
.low-zoom path.line.casing.tag-natural-tree_row {
stroke-width: 5;
}
.low-zoom path.line.stroke.tag-natural-tree_row {
stroke-width: 3;
}
/* barriers and similar */
path.line.stroke.tag-barrier:not(.tag-barrier-hedge) {
path.line.stroke.tag-barrier {
stroke: #ddd;
}
path.line.stroke.tag-barrier-hedge {
stroke: rgb(140, 208, 95);
}
path.line.stroke.tag-barrier,
path.line.stroke.tag-man_made-groyne,
path.line.stroke.tag-man_made-breakwater {
@@ -412,30 +464,6 @@ path.line.stroke.tag-crossing.tag-crossing-zebra {
}
/* Attractions */
path.line.shadow.tag-attraction-summer_toboggan,
path.line.shadow.tag-attraction-water_slide {
stroke-width: 16;
}
path.line.casing.tag-attraction-summer_toboggan,
path.line.casing.tag-attraction-water_slide {
stroke-width: 7;
}
path.line.stroke.tag-attraction-summer_toboggan,
path.line.stroke.tag-attraction-water_slide {
stroke-width: 5;
}
.low-zoom path.line.shadow.tag-attraction-summer_toboggan,
.low-zoom path.line.shadow.tag-attraction-water_slide {
stroke-width: 12;
}
.low-zoom path.line.casing.tag-attraction-summer_toboggan,
.low-zoom path.line.casing.tag-attraction-water_slide {
stroke-width: 5;
}
.low-zoom path.line.stroke.tag-attraction-summer_toboggan,
.low-zoom path.line.stroke.tag-attraction-water_slide {
stroke-width: 3;
}
path.line.stroke.tag-attraction-summer_toboggan {
stroke: #9e9e9e;
}
+2 -2
View File
@@ -84,8 +84,8 @@
"denotation": {"key": "denotation", "type": "combo", "label": "Denotation"},
"description": {"key": "description", "type": "textarea", "label": "Description", "universal": true},
"design": {"key": "design", "type": "combo", "label": "Design"},
"destination_oneway": {"key": "destination", "type": "semiCombo", "label": "Destinations", "prerequisiteTag": {"key": "oneway", "value": "yes"}},
"destination/ref_oneway": {"key": "destination:ref", "type": "semiCombo", "label": "Destination Road Numbers", "prerequisiteTag": {"key": "oneway", "value": "yes"}},
"destination_oneway": {"key": "destination", "type": "semiCombo", "label": "Destinations", "prerequisiteTag": {"key": "oneway", "value": "yes"}, "snake_case": false},
"destination/ref_oneway": {"key": "destination:ref", "type": "semiCombo", "label": "Destination Road Numbers", "prerequisiteTag": {"key": "oneway", "value": "yes"}, "snake_case": false},
"destination/symbol_oneway": {"key": "destination:symbol", "type": "semiCombo", "label": "Destination Symbols", "prerequisiteTag": {"key": "oneway", "value": "yes"}},
"devices": {"key": "devices", "type": "number", "minValue": 0, "label": "Devices", "placeholder": "1, 2, 3..."},
"diaper": {"key": "diaper", "type": "combo", "label": "Diaper Changing Available", "options": ["yes", "no", "room", "1", "2", "3", "4", "5"]},
@@ -5,5 +5,6 @@
"prerequisiteTag": {
"key": "oneway",
"value": "yes"
}
},
"snake_case": false
}
+2 -1
View File
@@ -5,5 +5,6 @@
"prerequisiteTag": {
"key": "oneway",
"value": "yes"
}
},
"snake_case": false
}
+1 -1
View File
@@ -4,7 +4,7 @@
"shortName": "iOSM",
"errorTypes": {
"ow": {
"icon": "",
"icon": "fas-long-arrow-alt-right",
"category": "routing"
},
"mr-both": {
+5 -4
View File
@@ -10,13 +10,14 @@ export function osmIsInterestingTag(key) {
export var osmOneWayTags = {
'aerialway': {
'chair_lift': true,
'mixed_lift': true,
't-bar': true,
'drag_lift': true,
'j-bar': true,
'magic_carpet': true,
'mixed_lift': true,
'platter': true,
'rope_tow': true,
'magic_carpet': true,
'yes': true
't-bar': true,
'zipline': true
},
'highway': {
'motorway': true
+19 -7
View File
@@ -4,8 +4,8 @@ import { osmPavedTags } from '../osm/tags';
export function svgTagClasses() {
var primaries = [
'building', 'highway', 'railway', 'waterway', 'aeroway',
'motorway', 'boundary', 'power', 'amenity', 'natural', 'landuse',
'building', 'highway', 'railway', 'waterway', 'aeroway', 'aerialway',
'piste:type', 'boundary', 'power', 'amenity', 'natural', 'landuse',
'leisure', 'military', 'place', 'man_made', 'route', 'attraction'
];
var statuses = [
@@ -30,27 +30,39 @@ export function svgTagClasses() {
}
var t = _tags(entity);
var isMultiPolygon = (t.type === 'multipolygon');
var shouldRenderLineAsArea = isMultiPolygon && !entity.hasInterestingTags();
var i, k, v;
// in some situations we want to render perimeter strokes a certain way
var overrideGeometry;
if (/\bstroke\b/.test(value)) {
if (!!t.barrier && t.barrier !== 'no') {
overrideGeometry = 'line';
} else if (t.type === 'multipolygon' && !entity.hasInterestingTags()) {
overrideGeometry = 'area';
}
}
// preserve base classes (nothing with `tag-`)
var classes = value.trim().split(/\s+/)
.filter(function(klass) {
return klass.length && !/^tag-/.test(klass);
})
.map(function(klass) { // style multipolygon inner/outers as areas not lines
return (klass === 'line' && shouldRenderLineAsArea) ? 'area' : klass;
.map(function(klass) { // special overrides for some perimeter strokes
return (klass === 'line' || klass === 'area') ? (overrideGeometry || klass) : klass;
});
// pick at most one primary classification tag..
for (i = 0; i < primaries.length; i++) {
k = primaries[i];
v = t[k];
if (!v || v === 'no') continue;
if (k === 'piste:type') { // avoid a ':' in the class name
k = 'piste';
}
primary = k;
if (statuses.indexOf(v) !== -1) { // e.g. `railway=abandoned`
status = v;
+2 -1
View File
@@ -98,7 +98,8 @@ export function uiFieldText(field, context) {
.merge(buttons)
.on('click', function(d) {
d3_event.preventDefault();
var vals = input.node().value.split(';');
var raw_vals = input.node().value || '0';
var vals = raw_vals.split(';');
vals = vals.map(function(v) {
var num = parseFloat(v.trim(), 10);
return isFinite(num) ? clamped(num + d) : v.trim();
@@ -0,0 +1 @@
<svg aria-hidden="true" data-prefix="fas" data-icon="long-arrow-alt-right" class="svg-inline--fa fa-long-arrow-alt-right fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"></path></svg>

After

Width:  |  Height:  |  Size: 468 B

+19
View File
@@ -209,6 +209,25 @@ describe('iD.svgTagClasses', function () {
expect(selection.attr('class')).to.equal('selected');
});
it('stroke overrides: renders areas with barriers as lines', function() {
selection
.attr('class', 'way area stroke')
.datum(iD.osmEntity({tags: {landuse: 'residential', barrier: 'hedge'}}))
.call(iD.svgTagClasses());
expect(selection.classed('area')).to.be.false;
expect(selection.classed('line')).to.be.true;
});
it('stroke overrides: renders simple multipolygon lines as areas', function() {
var multipolygon = function () { return { type: 'multipolygon' }; };
selection
.attr('class', 'way line stroke')
.datum(iD.osmEntity({tags: {}}))
.call(iD.svgTagClasses().tags(multipolygon));
expect(selection.classed('area')).to.be.true;
expect(selection.classed('line')).to.be.false;
});
it('works on SVG elements', function() {
selection = d3.select(document.createElementNS('http://www.w3.org/2000/svg', 'g'));
selection