diff --git a/features/az-cn-ir.geojson b/features/az-cn-ir.geojson
new file mode 100644
index 000000000..311051131
--- /dev/null
+++ b/features/az-cn-ir.geojson
@@ -0,0 +1,247 @@
+{
+ "coordinates": [
+ [
+ [48.415437922722475, 41.63699828114585],
+ [46.30639593263683, 41.793996993078565],
+ [45.9949964340704, 41.60564590284952],
+ [45.16291923437771, 41.40650831216402],
+ [45.07151098606428, 41.32823894985094],
+ [45.245215836533134, 41.0134235932496],
+ [45.4366628066322, 41.01393848136652],
+ [45.478126452826274, 40.93355363656485],
+ [45.976637356833066, 40.21808399137643],
+ [46.504788063365424, 39.58379391501532],
+ [46.48607977421085, 39.483860662078996],
+ [46.532510885445504, 38.89551679924722],
+ [46.50574141335974, 38.88638987604563],
+ [46.49711451188654, 38.88987442933396],
+ [46.4644052142454, 38.89054744402799],
+ [46.45618933381934, 38.8990722499405],
+ [46.41455981610599, 38.892856023013735],
+ [46.38761386940439, 38.90594874584582],
+ [46.36897739926482, 38.90999802692869],
+ [46.365346918068894, 38.916212753191246],
+ [46.33957516915916, 38.917143940044525],
+ [46.33330780250233, 38.90901621246587],
+ [46.31330015779227, 38.901689759802196],
+ [46.29251462706475, 38.90356821633816],
+ [46.27373074168614, 38.897600528210006],
+ [46.265345039470134, 38.88581896185329],
+ [46.256765003496554, 38.8831242896253],
+ [46.25212188668232, 38.87681635187829],
+ [46.22611506769337, 38.86379077396816],
+ [46.215283366555354, 38.8611603212054],
+ [46.21156847865029, 38.85443815452618],
+ [46.20112365523772, 38.85203601932619],
+ [46.19177439945429, 38.851198629631],
+ [46.18728807490035, 38.84308744481902],
+ [46.18178057916356, 38.84061251402116],
+ [46.17296815593323, 38.84055011453751],
+ [46.16603838675533, 38.84292125645794],
+ [46.159829634023964, 38.84108050840658],
+ [46.1546416772658, 38.84307523895484],
+ [46.14274142072506, 38.84174077557839],
+ [46.13957472132404, 38.84428852543209],
+ [46.14194104615143, 38.844559557282054],
+ [45.813423180428146, 39.54568424584261],
+ [44.83593898542438, 39.73432800976505],
+ [44.80149528828244, 39.654774987976765],
+ [44.61243934304861, 39.78784156447],
+ [43.190918132668315, 39.203350413010355],
+ [47.082513990774885, 28.278365829252408],
+ [61.743916386659805, 24.216562135369784],
+ [61.66253669826381, 25.37801887657247],
+ [61.84848857899976, 26.095736314562316],
+ [63.32884583852959, 27.14194681911502],
+ [61.55139517354044, 28.97753645826529],
+ [61.82407969306786, 30.96619814437142],
+ [60.873905363836286, 32.160404271666465],
+ [61.006505589281915, 34.7087128151538],
+ [61.3971485399226, 35.414961279989754],
+ [61.173636588566126, 36.518919448927804],
+ [59.15423173408337, 37.60605170132074],
+ [58.54611921520129, 37.69756305911791],
+ [58.405232856419275, 37.62976366376465],
+ [56.109734380422594, 38.4137452248973],
+ [54.65218822340282, 37.44910617782409],
+ [54.62249826191993, 37.449327082986386],
+ [53.211798427691946, 36.90999719120106],
+ [48.885303542763126, 42.06064324046332],
+ [48.415437922722475, 41.63699828114585]
+ ],
+ [
+ [107.99256501029947, 21.544636269264586],
+ [109.10963077564287, 21.215629503382956],
+ [107.54102251279727, 17.636636458506786],
+ [113.51907335253463, 17.9944557999778],
+ [113.85458535539789, 22.279331755166282],
+ [113.95757282399154, 22.475149852024344],
+ [114.07101181577366, 22.516394359602145],
+ [114.11332256269947, 22.52909588707162],
+ [114.12741863307593, 22.53921494371407],
+ [114.15254296520749, 22.554107154973053],
+ [114.15531163124484, 22.55401898555884],
+ [118.0623108612229, 22.336876386015064],
+ [124.93729161872534, 31.773936352353374],
+ [124.10292600915773, 39.58330591369153],
+ [124.37592151239807, 40.011340106893414],
+ [124.3616103590079, 40.07914707222881],
+ [126.28579137423878, 41.16031330233656],
+ [128.11744917863143, 41.35566366222238],
+ [129.22084545539582, 42.222785295368624],
+ [129.7452755313751, 42.465844177009956],
+ [129.8860234389557, 42.95656852254348],
+ [130.52282857869102, 42.568168793720616],
+ [130.52306994860362, 42.54683372080214],
+ [130.5733252925172, 42.43252736756702],
+ [130.63647477698436, 42.42754397056649],
+ [130.466459965475, 42.76950009272974],
+ [131.04824013508522, 42.85908068402597],
+ [131.31390831433646, 43.488916265270035],
+ [131.2536253014677, 44.01786036456579],
+ [131.19430942835453, 44.412592636846995],
+ [131.98092617910754, 45.267463251070836],
+ [131.9937013257088, 45.24371547622857],
+ [133.04197633380699, 44.988953585115496],
+ [134.85995799020486, 47.738373257018026],
+ [134.7414902893721, 48.38296836477275],
+ [130.2297796631765, 48.95531068163933],
+ [129.46592042449515, 49.49137341919035],
+ [127.60347868561098, 50.20094859499997],
+ [127.33684194192762, 50.34948223364077],
+ [127.38163152417036, 51.980001868971215],
+ [123.28989746327, 53.61027815010027],
+ [120.00612585757852, 53.259694601282035],
+ [117.37266499962345, 49.63518353347558],
+ [116.22713120699336, 45.750997140740964],
+ [111.9408775752824, 43.689990534445826],
+ [107.57009227516556, 42.41438116845413],
+ [101.28031320420621, 42.58752844552498],
+ [94.10809720581119, 44.71216219830535],
+ [91.00286805689154, 46.14175356295496],
+ [87.34170334384623, 49.154227535342415],
+ [85.60935012793095, 47.500105946907354],
+ [82.78190226076009, 46.683341699345334],
+ [82.55707280517379, 45.204910632564975],
+ [80.40040687752247, 44.21318722460046],
+ [80.39433188555955, 44.1899667740162],
+ [80.40192975040725, 44.157259909046815],
+ [80.62342348263059, 43.669169447913504],
+ [80.22082518965658, 42.704860996631],
+ [75.39784383595901, 40.553967723310194],
+ [73.90774135346658, 40.05436986750351],
+ [73.92358726361965, 39.694414216416476],
+ [74.80096204496931, 38.1488851733894],
+ [75.42815428770498, 36.8496084865252],
+ [78.634429888331, 34.161071811390414],
+ [78.7455387444154, 31.26400506134914],
+ [81.33182011481153, 30.145715350286054],
+ [81.49365418533813, 30.36943045778564],
+ [83.9854777949268, 29.32117284661183],
+ [85.34805341044307, 28.27933337672772],
+ [85.60983621287812, 28.252782824606314],
+ [85.9639714068872, 27.973508391939035],
+ [87.40223318964695, 27.831671563301285],
+ [88.7527051600764, 27.541862100849457],
+ [88.83076860004047, 27.386776657886927],
+ [88.91757569148473, 27.31624706611406],
+ [88.93684137621017, 27.335432868059712],
+ [88.94302049840945, 27.332557577023195],
+ [88.96087690415368, 27.311469818274347],
+ [89.80033832714986, 28.24080615600593],
+ [92.45919548054712, 27.795253554170245],
+ [94.69731084159105, 29.290112092945776],
+ [98.67206716806822, 27.654010669056632],
+ [98.11894059342387, 25.390968175452556],
+ [97.55915977846485, 24.752989335580907],
+ [97.62998766662304, 23.880353308733774],
+ [97.67260971054338, 23.84884332893283],
+ [97.8627955065482, 23.97421194153901],
+ [97.89713357764163, 23.98094372780595],
+ [97.88836066798825, 24.007799561105998],
+ [98.00213500477832, 24.049249154371807],
+ [98.82711683413822, 23.47826414093599],
+ [98.83595091737214, 23.480614153823183],
+ [98.87780231799934, 23.4814006716409],
+ [98.88220783340535, 23.177097780060066],
+ [99.23329846371257, 23.092984770653658],
+ [99.35920517477882, 22.492265891610472],
+ [99.17227227808792, 22.179239962158547],
+ [99.18649166921767, 22.17398532284514],
+ [99.5775455293288, 22.102504529805003],
+ [100.03115465180667, 21.679229710221293],
+ [101.25024993554189, 21.20244156081074],
+ [101.68090805662484, 21.187349166726392],
+ [101.67948264145622, 21.186104484121785],
+ [101.85276275337372, 21.21499015223708],
+ [101.67768712941972, 22.461464135564654],
+ [101.71400792057477, 22.481510395398303],
+ [102.17278521908707, 22.429965598412267],
+ [103.16382745480865, 22.601504864672407],
+ [103.64767786927337, 22.79069379445373],
+ [103.66817708835038, 22.76913100655314],
+ [103.67999142630396, 22.76457835303843],
+ [103.68404709455581, 22.754009107883007],
+ [103.69374543168198, 22.74661014966756],
+ [103.70176860148547, 22.745715742961337],
+ [103.72614446550597, 22.724664472923862],
+ [103.74025113768857, 22.708480341212024],
+ [103.82902216188, 22.61371246400458],
+ [103.92749084997018, 22.526536494188576],
+ [103.94103931264232, 22.525878311869292],
+ [103.95266535538417, 22.510562151825013],
+ [103.96419056319212, 22.50526216526231],
+ [103.97106803423054, 22.52326765949192],
+ [104.09832930800559, 22.808246785047942],
+ [104.13061694930911, 22.81100824469509],
+ [104.84990079400859, 22.93673009754741],
+ [105.29341389547204, 23.361298101240322],
+ [105.90092469069236, 22.934139010066446],
+ [105.99517556650017, 22.941744526540077],
+ [106.07270605746709, 22.995262931045787],
+ [106.31768017448672, 22.86636636473122],
+ [106.32408536315597, 22.873262111645815],
+ [106.49808467035336, 22.901405533287218],
+ [106.53562887107597, 22.940861849108472],
+ [106.73345872056615, 22.84930842365148],
+ [106.73702764907523, 22.848024532169603],
+ [106.73872896517224, 22.845173906906084],
+ [106.74275025776154, 22.84394811967134],
+ [106.74299772192188, 22.839957107953353],
+ [106.75191724956386, 22.83571320259233],
+ [106.75364949868083, 22.832491700112087],
+ [106.76666118590566, 22.827237403694767],
+ [106.77067190010268, 22.826712229229315],
+ [106.77411157302578, 22.79920318949746],
+ [106.8215370543059, 22.817547882971795],
+ [106.83103942086342, 22.792792752400672],
+ [106.57993155844713, 22.542047367288916],
+ [106.57973466528392, 22.473938469809937],
+ [106.58077729062558, 22.37319075469324],
+ [106.68231844715643, 22.003114121299348],
+ [106.71158215781958, 21.97332672273059],
+ [106.7137102629382, 21.971895540068687],
+ [106.77588610473771, 22.006156724283713],
+ [107.0262220691439, 21.818343222933194],
+ [107.19610335299274, 21.721860201197018],
+ [107.49077497455306, 21.597525826843224],
+ [107.49635422876565, 21.59411182529172],
+ [107.56026107540384, 21.613492478224202],
+ [107.5700427025804, 21.612432993326564],
+ [107.57259513778683, 21.616601139459476],
+ [107.66245310026397, 21.622142114378775],
+ [107.71514292305972, 21.621829770227194],
+ [107.7208181553865, 21.6280815380792],
+ [107.73443252857976, 21.63164891941217],
+ [107.74899329202555, 21.640305539838366],
+ [107.80517874723137, 21.658827433865483],
+ [107.86167516700914, 21.65084726566947],
+ [107.87920473705265, 21.630004893845268],
+ [107.94054733688608, 21.565857089764975],
+ [107.95358087344096, 21.53457821203672],
+ [107.9691211993391, 21.536570306285753],
+ [107.99256501029947, 21.544636269264586]
+ ]
+ ],
+ "type": "Polygon"
+}
diff --git a/features/id.geojson b/features/id.geojson
new file mode 100644
index 000000000..01b480705
--- /dev/null
+++ b/features/id.geojson
@@ -0,0 +1,30 @@
+{
+ "coordinates": [
+ [
+ [104.49997092455459, 1.3335724548830825],
+ [103.7287482111314, 1.1462418788494944],
+ [103.07972627976562, 1.33085761598133],
+ [96.55749213136266, 7.287802382061315],
+ [92.36823427088751, 5.404361532880429],
+ [95.69081588647111, -13.89938434982541],
+ [125.25226739635184, -11.188769373910986],
+ [124.60686788754981, -7.154373493931402],
+ [140.8545947529318, -9.98254604588827],
+ [140.93344293699823, -1.7541035198021433],
+ [126.93789026500053, 5.294981774025558],
+ [118.60148416136838, 3.864127075174096],
+ [117.52962530974867, 4.162638917505404],
+ [117.25499181762666, 4.386689165283414],
+ [115.72527554122189, 4.239497076930505],
+ [114.54945292849573, 1.4304074181337683],
+ [111.93511275127577, 1.1225920766968187],
+ [111.87587586068508, 1.030004506152423],
+ [110.35299910767776, 0.9892649799587758],
+ [109.97605061030862, 1.317920194475505],
+ [109.67981692872422, 1.612439356169972],
+ [109.5452864131048, 2.185452732731349],
+ [104.49997092455459, 1.3335724548830825]
+ ]
+ ],
+ "type": "Polygon"
+}
diff --git a/features/in.geojson b/features/in.geojson
new file mode 100644
index 000000000..660aab135
--- /dev/null
+++ b/features/in.geojson
@@ -0,0 +1,101 @@
+{
+ "coordinates": [
+ [
+ [67.96108733604024, 23.480324040057653],
+ [74.82651810696856, 5.9625214351809035],
+ [79.38726944838089, 8.385467092885392],
+ [79.65927438032855, 9.870173603290482],
+ [92.37083100198754, 20.703154188216956],
+ [92.96801558273836, 21.314971163676162],
+ [93.38887939674362, 23.362851528112287],
+ [93.43249188757773, 23.894661955832802],
+ [94.15359253196141, 23.848387274833968],
+ [94.31135642042761, 24.24506031620723],
+ [95.08211959822864, 26.48228840282421],
+ [96.15543565330086, 27.24684556521825],
+ [97.40648953368333, 27.980219340230008],
+ [96.06461644084135, 29.40543023547778],
+ [91.87614944759508, 27.71207753519623],
+ [91.65741475043961, 27.49431975935346],
+ [92.01865945012321, 27.478114398783916],
+ [92.1125120852526, 26.89217316300997],
+ [91.50334993671868, 26.794260160200963],
+ [91.2678430951081, 26.8087848399053],
+ [90.48417553289477, 26.86162366009208],
+ [89.86291594147758, 26.697042371389756],
+ [89.39235867359332, 26.840089893737925],
+ [89.38066976283721, 26.86156475629447],
+ [89.13824215555218, 26.806836861306394],
+ [88.87843215058649, 26.9454506012529],
+ [88.90510274955676, 27.276187895420335],
+ [88.83067691434428, 27.387012868156788],
+ [88.1646334722605, 27.942673800204332],
+ [88.02875525238807, 27.12209462441551],
+ [88.12193003556177, 26.94845870575098],
+ [88.16200236914068, 26.6450383743598],
+ [88.10360629273737, 26.54121979626356],
+ [87.86094095796363, 26.44925650883856],
+ [87.26660698693587, 26.374053414854103],
+ [87.26710788759544, 26.403010986397106],
+ [86.92267404393533, 26.52951490031367],
+ [86.89199024392559, 26.46379500706422],
+ [86.47587233415538, 26.55610329451146],
+ [86.16777368967462, 26.614622243213915],
+ [86.02923731264502, 26.66820985033243],
+ [85.84535838742084, 26.6100084904254],
+ [85.77044729306658, 26.630272690005285],
+ [85.74846304198263, 26.641616026332272],
+ [85.58680022673065, 26.856424669342687],
+ [85.33403524176373, 26.75644907869399],
+ [84.85575858460413, 26.988289416463815],
+ [84.8417526516032, 27.013909533650704],
+ [84.64584499386382, 27.047024558326356],
+ [84.6874760904268, 27.290310664500623],
+ [84.12409159445508, 27.514066215341202],
+ [83.69577998297035, 27.435662792672872],
+ [83.46995011413304, 27.476933723286635],
+ [83.22200496298791, 27.416012776925825],
+ [82.79347146824517, 27.498603773016356],
+ [81.9238502130346, 27.86742644941785],
+ [81.90170646263323, 27.855257042369033],
+ [81.60116742237165, 28.020098762108503],
+ [80.5521141615045, 28.693688170034918],
+ [80.12154613036535, 28.99179912187465],
+ [80.32615175450383, 29.301730643551963],
+ [80.24710807842393, 29.42727428920965],
+ [80.35970032315072, 29.562423556195284],
+ [80.37829581975245, 29.563128152568908],
+ [80.37902943736981, 29.57132371463011],
+ [80.38240999287808, 29.57099702396478],
+ [80.38813815637872, 29.571446223356986],
+ [80.39553116880916, 29.76177829890898],
+ [80.40777762139703, 29.790863277842377],
+ [80.42910086397376, 29.798109831701495],
+ [81.04080475408989, 30.235792682780385],
+ [78.81763059625172, 31.359511464913524],
+ [78.25497335568258, 34.66399351368179],
+ [73.96100626292403, 34.692804600293556],
+ [73.76914195217563, 34.38703257952726],
+ [73.90413397605727, 34.10378549195089],
+ [74.01530523860941, 33.23643705745441],
+ [74.6723514164861, 32.564410749040206],
+ [75.38318570040772, 32.27218557363868],
+ [75.02620714450813, 32.050284909273486],
+ [74.75734026970227, 31.95348787811045],
+ [74.57235118679066, 31.60453418353906],
+ [74.59149152364955, 31.417388681157874],
+ [74.54081293547017, 31.004829751304996],
+ [73.88283845828823, 30.366280150688866],
+ [73.90912367724471, 30.337517781355572],
+ [73.40036843712753, 29.9449340382574],
+ [73.00870321956708, 29.151319329842323],
+ [70.37603969999063, 28.00511945218608],
+ [69.42992970248244, 26.869561828995728],
+ [70.25782029846408, 25.73167203941165],
+ [71.02294898048973, 24.349533470418223],
+ [68.79091274271488, 24.217860090801878],
+ [67.96108733604024, 23.480324040057653]
+ ]
+ ],
+ "type": "Polygon"
+}
diff --git a/features/jp-kr.geojson b/features/jp-kr.geojson
new file mode 100644
index 000000000..125aeb882
--- /dev/null
+++ b/features/jp-kr.geojson
@@ -0,0 +1,21 @@
+{
+ "coordinates": [
+ [
+ [155.02665666028912, 46.27207227147338],
+ [139.19332477377503, 46.048258945609035],
+ [128.3553089190704, 38.6149134859138],
+ [128.1163199061627, 38.33797958980037],
+ [127.45109704261176, 38.31276883362],
+ [127.23434989235085, 38.331274234520635],
+ [127.04331095395668, 38.25764575763347],
+ [126.67086365951343, 37.957890363575046],
+ [126.66184496390719, 37.7812931207185],
+ [126.21089754196333, 37.83265681749103],
+ [122.6497862605799, 32.58851615682393],
+ [127.1377507648217, 28.866667942026652],
+ [155.34373212110467, 29.028340513204128],
+ [155.02665666028912, 46.27207227147338]
+ ]
+ ],
+ "type": "Polygon"
+}
diff --git a/icons/shield_in_ah_2.svg b/icons/shield_in_ah_2.svg
new file mode 100644
index 000000000..33e6e6165
--- /dev/null
+++ b/icons/shield_in_ah_2.svg
@@ -0,0 +1,45 @@
+
+
diff --git a/icons/shield_in_ah_3.svg b/icons/shield_in_ah_3.svg
new file mode 100644
index 000000000..429f7f1f7
--- /dev/null
+++ b/icons/shield_in_ah_3.svg
@@ -0,0 +1,45 @@
+
+
diff --git a/icons/shield_in_ah_4.svg b/icons/shield_in_ah_4.svg
new file mode 100644
index 000000000..0b048fdf0
--- /dev/null
+++ b/icons/shield_in_ah_4.svg
@@ -0,0 +1,45 @@
+
+
diff --git a/scripts/build.js b/scripts/build.js
index 5b56e9204..7ca2c2a1f 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -1,4 +1,4 @@
-import { stat, copyFile, mkdir } from "node:fs/promises";
+import { stat, copyFile, cp, mkdir } from "node:fs/promises";
import { pathToFileURL } from "node:url";
import esbuild from "esbuild";
@@ -20,12 +20,13 @@ const maybeLocalConfig = async (name = "local.config.js") => {
};
const buildWith = async (key, buildOptions) => {
- await mkdir("dist", { recursive: true });
+ await mkdir("dist/features", { recursive: true });
await Promise.all(
["index.html", "shieldtest.html", "favicon.ico"].map((f) =>
copyFile(`src/${f}`, `dist/${f}`)
)
);
+ await cp("features", "dist/features", {recursive: true});
const localConfig = await maybeLocalConfig();
diff --git a/scripts/status_map.js b/scripts/status_map.js
index 256bccc8f..4e439345d 100644
--- a/scripts/status_map.js
+++ b/scripts/status_map.js
@@ -13,6 +13,10 @@ function fillPaths(svg, codes) {
// Routes in United States insular areas use US prefix with the U.S.
selectors.add(".ust");
}
+ // The Asian Highway Network isn't a real country.
+ if (selectors.has(".ah")) {
+ selectors.delete(".ah");
+ }
return svg.replace(".supported", new Array(...selectors).join(",\n"));
}
diff --git a/src/js/shield.js b/src/js/shield.js
index 6e5549981..f30186697 100644
--- a/src/js/shield.js
+++ b/src/js/shield.js
@@ -301,6 +301,12 @@ function getShieldDef(routeDef) {
...shieldDef.overrideByRef[routeDef.ref],
};
}
+ if (shieldDef.overrideByName) {
+ shieldDef = {
+ ...shieldDef,
+ ...shieldDef.overrideByName[routeDef.wayName],
+ };
+ }
//Determine whether a route without a ref gets drawn
if (
diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js
index a0a4c2aa6..6589890d4 100644
--- a/src/js/shield_defs.js
+++ b/src/js/shield_defs.js
@@ -3238,6 +3238,32 @@ export function loadShields() {
// ASIA
+ // Asian Highway Network
+ shields["AsianHighway"] = roundedRectShield(
+ Color.shields.blue,
+ Color.shields.white
+ );
+ shields["AsianHighway"].overrideByName = {
+ green: roundedRectShield(Color.shields.green, Color.shields.white),
+ green_in: {
+ spriteBlank: ["shield_in_ah_2", "shield_in_ah_3", "shield_in_ah_4"],
+ textColor: Color.shields.white,
+ padding: {
+ left: 2,
+ right: 2,
+ top: 2,
+ bottom: 7,
+ },
+ },
+ white: roundedRectShield(Color.shields.white, Color.shields.black),
+ white_id: roundedRectShield(
+ Color.shields.white,
+ Color.shields.green,
+ Color.shields.black
+ ),
+ };
+ shields["AH"] = shields["AsianHighway"];
+
// Armenia
shields["am:national"] = roundedRectShield(
Color.shields.blue,
diff --git a/src/layer/highway_shield.js b/src/layer/highway_shield.js
index 968e024e3..be24ea1ee 100644
--- a/src/layer/highway_shield.js
+++ b/src/layer/highway_shield.js
@@ -7,17 +7,71 @@ export const namedRouteNetworks = [
"US:TX:Harris:HCTRA",
];
+let AsianHighwayBorders = {};
+
+export async function fetchFeatures(baseURL) {
+ if (Object.keys(AsianHighwayBorders).length !== 0) {
+ return;
+ }
+
+ let fetchFile = async function (name) {
+ let response = await fetch(`features/${name}.geojson`);
+ if (response.ok) {
+ AsianHighwayBorders[name] = await response.json();
+ } else {
+ throw response;
+ }
+ };
+ await Promise.all([
+ "az-cn-ir", "id", "in", "jp-kr",
+ ].map(f => fetchFile(f)));
+}
+
export function getImageNameExpression(routeIndex) {
+ const nullIsland = {type: "Polygon", coordinates: [[[0, 0], [0, 0], [0, 0]]]};
+
return [
- "concat",
- "shield\n",
+ "let",
+ "route",
["get", "route_" + routeIndex],
[
- "match",
- ["get", "route_" + routeIndex],
- namedRouteNetworks.map((n) => n + "="),
- ["concat", "\n", ["get", "name"]],
- "",
+ "concat",
+ "shield\n",
+ ["var", "route"],
+ [
+ "match",
+ ["var", "route"],
+ namedRouteNetworks.map((n) => n + "="),
+ ["concat", "\n", ["get", "name"]],
+ "",
+ ],
+ [
+ "match",
+ ["slice", ["var", "route"], 0, ["index-of", "=", ["var", "route"]]],
+ ["AsianHighway", "AH"],
+ [
+ "concat",
+ "\n",
+ [
+ "case",
+ // Azerbaijan, China, Iran
+ ["within", AsianHighwayBorders["az-cn-ir"] || nullIsland],
+ "green",
+ // Japan, South Korea
+ ["within", AsianHighwayBorders["jp-kr"] || nullIsland],
+ "white",
+ // Indonesia
+ ["within", AsianHighwayBorders.id || nullIsland],
+ "white_id",
+ // India
+ ["within", AsianHighwayBorders.in || nullIsland],
+ "green_in",
+ // Armenia, Cambodia, Malaysia, Myanmar, Philippines, Russia, Thailand, Vietnam
+ "blue",
+ ],
+ ],
+ "",
+ ],
],
];
}
@@ -43,6 +97,7 @@ export function parseImageName(imageName) {
return { imageName, network, ref, name };
}
+await fetchFeatures();
let shieldTextField = ["format"];
for (var i = 1; i <= 6; i++) {
shieldTextField.push(routeConcurrency(i));