WIP on external presets

- preset data is no longer bundled into iD.js
- some code pathways commented out re: external presets
- many changes so that tests can run without presets at start, or async
- still need to make sure fallbacks are always there (point, line, area, etc)
This commit is contained in:
Bryan Housel
2020-02-05 09:38:26 -05:00
parent a333a341ec
commit 0fe766d9a4
21 changed files with 1435 additions and 1435 deletions
+4 -2
View File
@@ -22,8 +22,9 @@ export function validationMismatchedGeometry(context) {
return null;
}
if (context.presets().matchTags(tagSuggestingArea, 'line') ===
context.presets().matchTags(tagSuggestingArea, 'area')) {
var asLine = context.presets().matchTags(tagSuggestingArea, 'line');
var asArea = context.presets().matchTags(tagSuggestingArea, 'area');
if (asLine && asArea && (asLine === asArea)) {
// these tags also allow lines and making this an area wouldn't matter
return null;
}
@@ -31,6 +32,7 @@ export function validationMismatchedGeometry(context) {
return tagSuggestingArea;
}
function makeConnectEndpointsFixOnClick(way, graph) {
// must have at least three nodes to close this automatically
if (way.nodes.length < 3) return null;
+1
View File
@@ -56,6 +56,7 @@ export function validationOutdatedTags(context) {
const oldTags = Object.assign({}, entity.tags); // shallow copy
let preset = context.presets().match(entity, graph);
let subtype = 'deprecated_tags';
if (!preset) return [];
// upgrade preset..
if (preset.replacement) {