mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
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:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user