form attribute optional for presets

This commit is contained in:
Ansis Brammanis
2013-03-05 11:27:15 -05:00
parent b8f3292c2b
commit 3fd7217894
2 changed files with 12 additions and 22 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
iD.presets.Preset = function(preset, forms) {
preset.form = preset.form.map(function(f) {
preset.form = preset.form ? preset.form.map(function(f) {
if (typeof f === 'string') {
return forms[f];
} else {
return f;
}
});
}) : [];
preset.matchType = function(entity, resolver) {
return preset.match.type.indexOf(entity.geometry(resolver)) >= 0;
+10 -20
View File
@@ -18,8 +18,7 @@
"leisure": "park"
}
},
"icon": "park",
"form": []
"icon": "park"
},
{
"name": "water",
@@ -29,8 +28,7 @@
"natural": "water"
}
},
"icon": "",
"form": []
"icon": ""
},
{
"name": "wetland",
@@ -40,8 +38,7 @@
"natural": "wetland"
}
},
"icon": "",
"form": []
"icon": ""
},
{
"name": "wood",
@@ -51,8 +48,7 @@
"natural": "wood"
}
},
"icon": "",
"form": []
"icon": ""
},
{
"name": "coastline",
@@ -62,8 +58,7 @@
"natural": "coastline"
}
},
"icon": "",
"form": []
"icon": ""
},
{
"name": "supermarket",
@@ -249,8 +244,7 @@
"waterway": "river"
}
},
"icon": "waterway-river",
"form": []
"icon": "waterway-river"
},
{
"name": "stream",
@@ -337,8 +331,7 @@
"railway": "rail"
}
},
"icon": "railway-rail",
"form": []
"icon": "railway-rail"
},
{
"name": "subway",
@@ -348,8 +341,7 @@
"railway": "subway"
}
},
"icon": "railway-rail",
"form": []
"icon": "railway-rail"
},
{
"name": "trunk highway",
@@ -370,8 +362,7 @@
"highway": "footway"
}
},
"icon": "highway-footway",
"form": []
"icon": "highway-footway"
},
{
"name": "cycle path",
@@ -460,7 +451,6 @@
"highway": "turning_circle"
}
},
"icon": "circle",
"form": []
"icon": "circle"
}
]