forward on preset ui work
Add maki icons
@@ -530,21 +530,39 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;}
|
||||
}
|
||||
|
||||
.inspector-inner.type {
|
||||
border: 1px solid #eee;
|
||||
z-index:1;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.inspector-inner.type .preset-icon {
|
||||
width: 50px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 13px;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.inspector-inner.type .preset-label-wrap {
|
||||
height: 50px;
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.inspector-inner.type .preset-name {
|
||||
display: inline-block;
|
||||
margin-left: 20px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.inspector-inner .info {
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.inspector-inner.head {
|
||||
border: 1px solid #eee;
|
||||
z-index:1;
|
||||
position:relative;
|
||||
}
|
||||
@@ -654,9 +672,17 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;}
|
||||
float: left;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: red;
|
||||
//background: red;
|
||||
color: black;
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.preset-grid .grid-entry img {
|
||||
width: 24px;
|
||||
margin-left: 20px;
|
||||
padding: 18px;
|
||||
background: #eee;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.preset-grid-search-wrap {
|
||||
@@ -1459,6 +1485,7 @@ a.success-action {
|
||||
.inspector-preset.cf,
|
||||
.preset-section-input.cf {
|
||||
width: 100%;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.preset-search-input {
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
var id = iD();
|
||||
|
||||
d3.json('keys.json', function(err, keys) {
|
||||
d3.json('presets/presets_josm.json', function(err, presets_data) {
|
||||
d3.json('presets/presets.json', function(err, presets_data) {
|
||||
|
||||
id.connection()
|
||||
.keys(keys)
|
||||
|
||||
@@ -17,7 +17,7 @@ iD.presetData = function() {
|
||||
presets.match = function(entity) {
|
||||
var type = entity.type == 'node' ? 'node' : entity.geometry();
|
||||
return data.filter(function(d) {
|
||||
return _.contains(d.type, type);
|
||||
return _.contains(d.match.type, type);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -28,8 +28,8 @@ iD.presetData = function() {
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
count = 0;
|
||||
tags = data[i].tags;
|
||||
if (!_.contains(data[i].type, type)) continue;
|
||||
tags = data[i].match.tags;
|
||||
if (!_.contains(data[i].match.type, type)) continue;
|
||||
for (var k in tags) {
|
||||
if (entity.tags[k] == tags[k]) count++;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ iD.ui.preset = function() {
|
||||
preset;
|
||||
|
||||
function getTags() {
|
||||
var tags = _.clone(preset.tags);
|
||||
var tags = _.clone(preset.match.tags);
|
||||
sections.selectAll('input,select')
|
||||
.each(function(d) {
|
||||
tags[d.key] = this.value;
|
||||
@@ -79,7 +79,7 @@ iD.ui.preset = function() {
|
||||
var w = this.append('span').attr('class', 'input-wrap-position');
|
||||
i = w.append('input');
|
||||
w.call(d3.combobox()
|
||||
.data([''].concat(d.values.slice()).map(function(o) {
|
||||
.data([''].concat(d.option.slice()).map(function(o) {
|
||||
return { value: o, title: o };
|
||||
})));
|
||||
break;
|
||||
@@ -92,7 +92,7 @@ iD.ui.preset = function() {
|
||||
function presets(selection) {
|
||||
selection.html('');
|
||||
sections = selection.selectAll('div.preset-section')
|
||||
.data(preset.main)
|
||||
.data(preset.form)
|
||||
.enter()
|
||||
.append('div')
|
||||
.attr('class', 'preset-section cf');
|
||||
@@ -104,7 +104,7 @@ iD.ui.preset = function() {
|
||||
.attr('class', 'col4 preset-label')
|
||||
.append('label')
|
||||
.attr('for', 'input-' + d.key)
|
||||
.text(d.text);
|
||||
.text(d.key);
|
||||
input.call(wrap.append('div')
|
||||
.attr('class', 'col8 preset-input'), d);
|
||||
});
|
||||
|
||||
@@ -47,14 +47,17 @@ iD.ui.PresetGrid = function() {
|
||||
.selectAll('div.grid-entry')
|
||||
.data(presets.slice(0, 12), name);
|
||||
|
||||
entries.enter()
|
||||
var entered = entries.enter()
|
||||
.append('div')
|
||||
.attr('class', 'grid-entry')
|
||||
.text(name)
|
||||
.on('click', function(d) {
|
||||
event.choose(d);
|
||||
});
|
||||
|
||||
entered.append('img')
|
||||
.attr('src', function(d) { return '/presets/maki/' + d.icon; });
|
||||
entered.append('span').text(name);
|
||||
|
||||
entries.exit().remove();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,19 +30,31 @@ iD.ui.TagEditor = function() {
|
||||
.text('Type');
|
||||
|
||||
typewrap.append('img')
|
||||
.attr('class', 'preset-icon');
|
||||
.attr('class', 'preset-icon')
|
||||
.attr('src', presetMatch ? '/presets/maki/' + presetMatch.icon : '');
|
||||
|
||||
typewrap.append('h3')
|
||||
var typelabel = typewrap.append('div')
|
||||
.attr('class', 'preset-label-wrap');
|
||||
|
||||
typelabel.append('h3')
|
||||
.attr('class', 'preset-name')
|
||||
.text(presetMatch ? presetMatch.name : '');
|
||||
|
||||
typelabel.append('span')
|
||||
.attr('class', 'preset-geometry')
|
||||
.text(entity.geometry(context.graph()));
|
||||
|
||||
typewrap.append('div')
|
||||
.attr('class', 'info fillD');
|
||||
|
||||
var namewrap = editorwrap.append('div')
|
||||
.attr('class', 'head inspector-inner fillL'),
|
||||
namelabel = namewrap.append('h4')
|
||||
.text('Name'),
|
||||
h2 = namewrap.append('h2');
|
||||
|
||||
h2.append('span')
|
||||
.attr('class', 'icon big icon-pre-text big-' + entity.geometry(context.graph()));
|
||||
h2.append('div')
|
||||
.attr('class', 'info fillD');
|
||||
|
||||
var name = h2.append('input')
|
||||
.attr('placeholder', 'name')
|
||||
|
||||
|
After Width: | Height: | Size: 658 B |
|
After Width: | Height: | Size: 675 B |
|
After Width: | Height: | Size: 771 B |
|
After Width: | Height: | Size: 969 B |
|
After Width: | Height: | Size: 332 B |
|
After Width: | Height: | Size: 633 B |
|
After Width: | Height: | Size: 832 B |
|
After Width: | Height: | Size: 631 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 891 B |
|
After Width: | Height: | Size: 370 B |
|
After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 651 B |
|
After Width: | Height: | Size: 420 B |
|
After Width: | Height: | Size: 667 B |
|
After Width: | Height: | Size: 629 B |
|
After Width: | Height: | Size: 854 B |
|
After Width: | Height: | Size: 835 B |
|
After Width: | Height: | Size: 314 B |
|
After Width: | Height: | Size: 650 B |
|
After Width: | Height: | Size: 546 B |
|
After Width: | Height: | Size: 537 B |
|
After Width: | Height: | Size: 845 B |
|
After Width: | Height: | Size: 911 B |
|
After Width: | Height: | Size: 524 B |
|
After Width: | Height: | Size: 885 B |
|
After Width: | Height: | Size: 604 B |
|
After Width: | Height: | Size: 502 B |
|
After Width: | Height: | Size: 751 B |
|
After Width: | Height: | Size: 589 B |
|
After Width: | Height: | Size: 349 B |
|
After Width: | Height: | Size: 429 B |
|
After Width: | Height: | Size: 639 B |
|
After Width: | Height: | Size: 558 B |
|
After Width: | Height: | Size: 892 B |
|
After Width: | Height: | Size: 678 B |
|
After Width: | Height: | Size: 952 B |
|
After Width: | Height: | Size: 869 B |
|
After Width: | Height: | Size: 416 B |
|
After Width: | Height: | Size: 765 B |
|
After Width: | Height: | Size: 682 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 537 B |
|
After Width: | Height: | Size: 748 B |
|
After Width: | Height: | Size: 647 B |
|
After Width: | Height: | Size: 906 B |
|
After Width: | Height: | Size: 666 B |
|
After Width: | Height: | Size: 587 B |
|
After Width: | Height: | Size: 303 B |
|
After Width: | Height: | Size: 387 B |
|
After Width: | Height: | Size: 549 B |
|
After Width: | Height: | Size: 549 B |
|
After Width: | Height: | Size: 341 B |
|
After Width: | Height: | Size: 706 B |
|
After Width: | Height: | Size: 1015 B |
|
After Width: | Height: | Size: 478 B |
|
After Width: | Height: | Size: 662 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 568 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 274 B |
|
After Width: | Height: | Size: 313 B |
|
After Width: | Height: | Size: 715 B |
|
After Width: | Height: | Size: 889 B |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 705 B |
|
After Width: | Height: | Size: 868 B |
|
After Width: | Height: | Size: 703 B |
|
After Width: | Height: | Size: 572 B |
|
After Width: | Height: | Size: 616 B |
|
After Width: | Height: | Size: 845 B |
|
After Width: | Height: | Size: 556 B |
|
After Width: | Height: | Size: 526 B |
|
After Width: | Height: | Size: 861 B |
|
After Width: | Height: | Size: 746 B |
@@ -1,22 +1,4 @@
|
||||
[
|
||||
{
|
||||
"title": "Highway",
|
||||
"name": "highway",
|
||||
"match": {
|
||||
"type": ["line"],
|
||||
"tags": {
|
||||
"highway": "*"
|
||||
}
|
||||
},
|
||||
"form": [
|
||||
{
|
||||
"tag": "highway",
|
||||
"title": "Highway Type",
|
||||
"type": "select",
|
||||
"option": ["primary", "secondary", "tertiary"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Cafe",
|
||||
"name": "cafe",
|
||||
@@ -26,31 +8,16 @@
|
||||
"amenity": "cafe"
|
||||
}
|
||||
},
|
||||
"icon": "cafe-24.png",
|
||||
"form": [
|
||||
{
|
||||
"tag": "phone",
|
||||
"type": "tel"
|
||||
},
|
||||
{
|
||||
"tag": "fax",
|
||||
"type": "tel"
|
||||
},
|
||||
{
|
||||
"tag": "website",
|
||||
"type": "url"
|
||||
},
|
||||
{
|
||||
"tag": "email",
|
||||
"type": "email"
|
||||
},
|
||||
{
|
||||
"tag": "internet_access",
|
||||
"key": "internet_access",
|
||||
"title": "Internet Access",
|
||||
"type": "select",
|
||||
"option": ["yes", "wlan","wired","terminal","no"]
|
||||
},
|
||||
{
|
||||
"tag": "internet_access:fee",
|
||||
"key": "internet_access:fee",
|
||||
"title": "Internet Access Fee",
|
||||
"type": "select",
|
||||
"option": ["yes", "no"]
|
||||
|
||||