forked from MapComplete/MapComplete
Fix some bugs in generation script
This commit is contained in:
parent
e3939f1086
commit
2ecdee9245
2 changed files with 903 additions and 302 deletions
|
|
@ -80,6 +80,7 @@ function main(){
|
||||||
const signs = JSON.parse(signFile) as SignFile;
|
const signs = JSON.parse(signFile) as SignFile;
|
||||||
for(const sign of signs.traffic_signs){
|
for(const sign of signs.traffic_signs){
|
||||||
const originalMapping = originalSignMappings.find(m => m.if === "traffic_sign=" + sign.id);
|
const originalMapping = originalSignMappings.find(m => m.if === "traffic_sign=" + sign.id);
|
||||||
|
const iconPath = "./assets/layers/traffic_sign/images/"+signs.country.toLowerCase()+"/"+sign.image.file
|
||||||
// Create new mapping, reusing original translations
|
// Create new mapping, reusing original translations
|
||||||
const mapping: MappingConfigJson = {
|
const mapping: MappingConfigJson = {
|
||||||
if: "traffic_sign=" + sign.id,
|
if: "traffic_sign=" + sign.id,
|
||||||
|
|
@ -87,12 +88,16 @@ function main(){
|
||||||
...originalMapping?.then,
|
...originalMapping?.then,
|
||||||
en: sign.name,
|
en: sign.name,
|
||||||
},
|
},
|
||||||
hideInAnswer: "_country!="+signs.country.toLowerCase()
|
hideInAnswer: "_country!="+signs.country.toLowerCase(),
|
||||||
|
icon: {
|
||||||
|
path: iconPath,
|
||||||
|
class: "large"
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const icon: MappingConfigJson = {
|
const icon: MappingConfigJson = {
|
||||||
if: "traffic_sign=" + sign.id + "(;.*)*$",
|
if: "traffic_sign~" + sign.id + "(;.*)*$",
|
||||||
then:
|
then: iconPath
|
||||||
"./assets/layers/traffic_sign/images/"+signs.country.toLowerCase()+"/"+sign.image.file
|
|
||||||
};
|
};
|
||||||
mappings.push(mapping);
|
mappings.push(mapping);
|
||||||
iconMappings.push(icon);
|
iconMappings.push(icon);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue