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
+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();