|
|
@ -76,6 +76,8 @@ function checkFallbackLevel(req, hit) { |
|
|
|
return 0.8; |
|
|
|
return 0.8; |
|
|
|
case 'street': |
|
|
|
case 'street': |
|
|
|
return 0.8; |
|
|
|
return 0.8; |
|
|
|
|
|
|
|
case 'postalcode': |
|
|
|
|
|
|
|
return 0.8;
|
|
|
|
case 'localadmin': |
|
|
|
case 'localadmin': |
|
|
|
case 'locality': |
|
|
|
case 'locality': |
|
|
|
case 'borough': |
|
|
|
case 'borough': |
|
|
@ -137,38 +139,44 @@ const fallbackRules = [ |
|
|
|
expectedLayers: ['street'] |
|
|
|
expectedLayers: ['street'] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'neighbourhood', |
|
|
|
name: 'postalcode', |
|
|
|
notSet: ['query', 'number', 'street'], |
|
|
|
notSet: ['query', 'number', 'street'], |
|
|
|
|
|
|
|
set: ['postalcode'], |
|
|
|
|
|
|
|
expectedLayers: ['postalcode'] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name: 'neighbourhood', |
|
|
|
|
|
|
|
notSet: ['query', 'number', 'street', 'postalcode'], |
|
|
|
set: ['neighbourhood'], |
|
|
|
set: ['neighbourhood'], |
|
|
|
expectedLayers: ['neighbourhood'] |
|
|
|
expectedLayers: ['neighbourhood'] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'borough', |
|
|
|
name: 'borough', |
|
|
|
notSet: ['query', 'number', 'street', 'neighbourhood'], |
|
|
|
notSet: ['query', 'number', 'street', 'postalcode', 'neighbourhood'], |
|
|
|
set: ['borough'], |
|
|
|
set: ['borough'], |
|
|
|
expectedLayers: ['borough'] |
|
|
|
expectedLayers: ['borough'] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'city', |
|
|
|
name: 'city', |
|
|
|
notSet: ['query', 'number', 'street', 'neighbourhood', 'borough'], |
|
|
|
notSet: ['query', 'number', 'street', 'postalcode', 'neighbourhood', 'borough'], |
|
|
|
set: ['city'], |
|
|
|
set: ['city'], |
|
|
|
expectedLayers: ['borough', 'locality', 'localadmin'] |
|
|
|
expectedLayers: ['borough', 'locality', 'localadmin'] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'county', |
|
|
|
name: 'county', |
|
|
|
notSet: ['query', 'number', 'street', 'neighbourhood', 'borough', 'city'], |
|
|
|
notSet: ['query', 'number', 'street', 'postalcode', 'neighbourhood', 'borough', 'city'], |
|
|
|
set: ['county'], |
|
|
|
set: ['county'], |
|
|
|
expectedLayers: ['county'] |
|
|
|
expectedLayers: ['county'] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'state', |
|
|
|
name: 'state', |
|
|
|
notSet: ['query', 'number', 'street', 'neighbourhood', 'borough', 'city', 'county'], |
|
|
|
notSet: ['query', 'number', 'street', 'postalcode', 'neighbourhood', 'borough', 'city', 'county'], |
|
|
|
set: ['state'], |
|
|
|
set: ['state'], |
|
|
|
expectedLayers: ['region'] |
|
|
|
expectedLayers: ['region'] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'country', |
|
|
|
name: 'country', |
|
|
|
notSet: ['query', 'number', 'street', 'neighbourhood', 'borough', 'city', 'county', 'state'], |
|
|
|
notSet: ['query', 'number', 'street', 'postalcode', 'neighbourhood', 'borough', 'city', 'county', 'state'], |
|
|
|
set: ['country'], |
|
|
|
set: ['country'], |
|
|
|
expectedLayers: ['country'] |
|
|
|
expectedLayers: ['country'] |
|
|
|
} |
|
|
|
} |
|
|
|