@versatiles/style 5.8.2 → 5.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +14 -14
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +570 -333
  4. package/dist/index.js.map +1 -1
  5. package/package.json +13 -8
  6. package/src/color/abstract.ts +1 -1
  7. package/src/color/hsl.test.ts +10 -16
  8. package/src/color/hsl.ts +11 -15
  9. package/src/color/hsv.test.ts +4 -10
  10. package/src/color/hsv.ts +38 -22
  11. package/src/color/index.test.ts +2 -4
  12. package/src/color/index.ts +1 -1
  13. package/src/color/random.test.ts +1 -1
  14. package/src/color/random.ts +127 -25
  15. package/src/color/rgb.test.ts +55 -36
  16. package/src/color/rgb.ts +35 -48
  17. package/src/color/utils.test.ts +4 -6
  18. package/src/color/utils.ts +1 -3
  19. package/src/guess_style/guess_style.test.ts +49 -43
  20. package/src/guess_style/guess_style.ts +64 -21
  21. package/src/guess_style/index.ts +0 -1
  22. package/src/index.test.ts +34 -7
  23. package/src/index.ts +29 -19
  24. package/src/lib/utils.test.ts +2 -2
  25. package/src/lib/utils.ts +2 -1
  26. package/src/shortbread/index.ts +0 -1
  27. package/src/shortbread/layers.test.ts +19 -3
  28. package/src/shortbread/layers.ts +204 -194
  29. package/src/shortbread/properties.test.ts +3 -4
  30. package/src/shortbread/properties.ts +18 -4
  31. package/src/shortbread/template.test.ts +7 -2
  32. package/src/shortbread/template.ts +7 -14
  33. package/src/style_builder/decorator.test.ts +4 -4
  34. package/src/style_builder/decorator.ts +29 -21
  35. package/src/style_builder/recolor.test.ts +6 -31
  36. package/src/style_builder/recolor.ts +20 -20
  37. package/src/style_builder/style_builder.test.ts +50 -13
  38. package/src/style_builder/style_builder.ts +29 -31
  39. package/src/style_builder/types.ts +85 -2
  40. package/src/styles/LICENSE.md +15 -15
  41. package/src/styles/colorful.test.ts +91 -0
  42. package/src/styles/colorful.ts +229 -122
  43. package/src/styles/eclipse.ts +1 -1
  44. package/src/styles/empty.ts +1 -1
  45. package/src/styles/graybeard.ts +2 -2
  46. package/src/styles/index.ts +0 -3
  47. package/src/styles/neutrino.ts +14 -16
  48. package/src/styles/shadow.ts +2 -2
  49. package/src/types/index.ts +0 -1
  50. package/src/types/maplibre.ts +17 -3
  51. package/src/types/tilejson.test.ts +8 -5
  52. package/src/types/tilejson.ts +13 -13
  53. package/src/types/vector_layer.test.ts +4 -1
  54. package/src/types/vector_layer.ts +7 -7
@@ -10,7 +10,6 @@ export default class Colorful extends StyleBuilder {
10
10
  };
11
11
 
12
12
  public defaultColors: StyleBuilderColors = {
13
-
14
13
  /** Color for land areas on the map. */
15
14
  land: '#F9F4EE',
16
15
 
@@ -139,7 +138,7 @@ export default class Colorful extends StyleBuilder {
139
138
  const { colors, fonts } = options;
140
139
  return {
141
140
  // background
142
- 'background': {
141
+ background: {
143
142
  color: colors.land,
144
143
  },
145
144
 
@@ -302,7 +301,8 @@ export default class Colorful extends StyleBuilder {
302
301
  color: colors.buildingbg,
303
302
  opacity: { 14: 0, 15: 1 },
304
303
  },
305
- 'building': { // fake 2.5d with translate
304
+ building: {
305
+ // fake 2.5d with translate
306
306
  color: colors.building,
307
307
  opacity: { 14: 0, 15: 1 },
308
308
  fillTranslate: [-2, -2],
@@ -338,7 +338,7 @@ export default class Colorful extends StyleBuilder {
338
338
 
339
339
  // bridge
340
340
 
341
- 'bridge': {
341
+ bridge: {
342
342
  color: colors.land.darken(0.02),
343
343
  fillAntialias: true,
344
344
  opacity: 0.8,
@@ -388,40 +388,39 @@ export default class Colorful extends StyleBuilder {
388
388
  opacity: 0.5,
389
389
  },
390
390
  'bridge-street-motorway:bridge': {
391
- size: { '5': 0, '6': 3, '10': 7, '14': 7, '16': 20, '18': 53, '19': 118, '20': 235 }
391
+ size: { '5': 0, '6': 3, '10': 7, '14': 7, '16': 20, '18': 53, '19': 118, '20': 235 },
392
392
  },
393
393
  'bridge-street-trunk:bridge': {
394
- size: { '7': 0, '8': 3, '10': 6, '14': 8, '16': 17, '18': 50, '19': 104, '20': 202 }
394
+ size: { '7': 0, '8': 3, '10': 6, '14': 8, '16': 17, '18': 50, '19': 104, '20': 202 },
395
395
  },
396
396
  'bridge-street-primary:bridge': {
397
- size: { '8': 0, '9': 1, '10': 6, '14': 8, '16': 17, '18': 50, '19': 104, '20': 202 }
397
+ size: { '8': 0, '9': 1, '10': 6, '14': 8, '16': 17, '18': 50, '19': 104, '20': 202 },
398
398
  },
399
399
  'bridge-street-secondary:bridge': {
400
400
  size: { '11': 3, '14': 7, '16': 11, '18': 42, '19': 95, '20': 193 },
401
- opacity: { '11': 0, '12': 1 }
401
+ opacity: { '11': 0, '12': 1 },
402
402
  },
403
403
  'bridge-street-motorway-link:bridge': {
404
404
  minzoom: 12,
405
- size: { '12': 3, '14': 4, '16': 10, '18': 20, '20': 56 }
405
+ size: { '12': 3, '14': 4, '16': 10, '18': 20, '20': 56 },
406
406
  },
407
407
  'bridge-street-{trunk,primary,secondary}-link:bridge': {
408
408
  minzoom: 13,
409
- size: { '12': 3, '14': 4, '16': 10, '18': 20, '20': 56 }
409
+ size: { '12': 3, '14': 4, '16': 10, '18': 20, '20': 56 },
410
410
  },
411
411
  'bridge-street-{tertiary,tertiary-link,unclassified,residential,livingstreet,pedestrian}*:bridge': {
412
412
  size: { '12': 3, '14': 4, '16': 8, '18': 36, '19': 90, '20': 179 },
413
- opacity: { '12': 0, '13': 1 }
413
+ opacity: { '12': 0, '13': 1 },
414
414
  },
415
415
  'bridge-street-{service,track}:bridge': {
416
416
  size: { '14': 3, '16': 6, '18': 25, '19': 67, '20': 134 },
417
- opacity: { '14': 0, '15': 1 }
417
+ opacity: { '14': 0, '15': 1 },
418
418
  },
419
419
  'bridge-way-*:bridge': {
420
420
  size: { '15': 0, '16': 7, '18': 10, '19': 17, '20': 31 },
421
- minzoom: 15
421
+ minzoom: 15,
422
422
  },
423
423
 
424
-
425
424
  // special color: motorway
426
425
  '{bridge-,}street-motorway{-link,}:outline': {
427
426
  color: colors.motorwaybg,
@@ -874,177 +873,285 @@ export default class Colorful extends StyleBuilder {
874
873
  color: colors.poi,
875
874
  },
876
875
  'poi-amenity': {
877
- image: ['match',
876
+ image: [
877
+ 'match',
878
878
  ['get', 'amenity'],
879
- 'arts_centre', 'basics:icon-art_gallery',
880
- 'atm', 'basics:icon-atm',
881
- 'bank', 'basics:icon-bank',
882
- 'bar', 'basics:icon-bar',
883
- 'bench', 'basics:icon-bench',
884
- 'bicycle_rental', 'basics:icon-bicycle_share',
885
- 'biergarten', 'basics:icon-beergarden',
886
- 'cafe', 'basics:icon-cafe',
887
- 'car_rental', 'basics:icon-car_rental',
888
- 'car_sharing', 'basics:icon-car_rental',
889
- 'car_wash', 'basics:icon-car_wash',
890
- 'cinema', 'basics:icon-cinema',
879
+ 'arts_centre',
880
+ 'basics:icon-art_gallery',
881
+ 'atm',
882
+ 'basics:icon-atm',
883
+ 'bank',
884
+ 'basics:icon-bank',
885
+ 'bar',
886
+ 'basics:icon-bar',
887
+ 'bench',
888
+ 'basics:icon-bench',
889
+ 'bicycle_rental',
890
+ 'basics:icon-bicycle_share',
891
+ 'biergarten',
892
+ 'basics:icon-beergarden',
893
+ 'cafe',
894
+ 'basics:icon-cafe',
895
+ 'car_rental',
896
+ 'basics:icon-car_rental',
897
+ 'car_sharing',
898
+ 'basics:icon-car_rental',
899
+ 'car_wash',
900
+ 'basics:icon-car_wash',
901
+ 'cinema',
902
+ 'basics:icon-cinema',
891
903
  //'clinic', 'basics:icon-clinic',
892
- 'college', 'basics:icon-college',
893
- 'community_centre', 'basics:icon-community',
904
+ 'college',
905
+ 'basics:icon-college',
906
+ 'community_centre',
907
+ 'basics:icon-community',
894
908
  //'courthouse', 'basics:icon-courthouse',
895
- 'dentist', 'basics:icon-dentist',
896
- 'doctors', 'basics:icon-doctor',
897
- 'dog_park', 'basics:icon-dog_park',
898
- 'drinking_water', 'basics:icon-drinking_water',
899
- 'embassy', 'basics:icon-embassy',
900
- 'fast_food', 'basics:icon-fast_food',
901
- 'fire_station', 'basics:icon-fire_station',
909
+ 'dentist',
910
+ 'basics:icon-dentist',
911
+ 'doctors',
912
+ 'basics:icon-doctor',
913
+ 'dog_park',
914
+ 'basics:icon-dog_park',
915
+ 'drinking_water',
916
+ 'basics:icon-drinking_water',
917
+ 'embassy',
918
+ 'basics:icon-embassy',
919
+ 'fast_food',
920
+ 'basics:icon-fast_food',
921
+ 'fire_station',
922
+ 'basics:icon-fire_station',
902
923
  //'food_court', 'basics:icon-food_court',
903
- 'fountain', 'basics:icon-fountain',
904
- 'grave_yard', 'basics:icon-cemetery',
905
- 'hospital', 'basics:icon-hospital',
906
- 'hunting_stand', 'basics:icon-huntingstand',
907
- 'library', 'basics:icon-library',
908
- 'marketplace', 'basics:icon-marketplace',
909
- 'nightclub', 'basics:icon-nightclub',
910
- 'nursing_home', 'basics:icon-nursinghome',
911
- 'pharmacy', 'basics:icon-pharmacy',
912
- 'place_of_worship', 'basics:icon-place_of_worship',
913
- 'playground', 'basics:icon-playground',
914
- 'police', 'basics:icon-police',
915
- 'post_box', 'basics:icon-postbox',
916
- 'post_office', 'basics:icon-post',
917
- 'prison', 'basics:icon-prison',
918
- 'pub', 'basics:icon-beer',
924
+ 'fountain',
925
+ 'basics:icon-fountain',
926
+ 'grave_yard',
927
+ 'basics:icon-cemetery',
928
+ 'hospital',
929
+ 'basics:icon-hospital',
930
+ 'hunting_stand',
931
+ 'basics:icon-huntingstand',
932
+ 'library',
933
+ 'basics:icon-library',
934
+ 'marketplace',
935
+ 'basics:icon-marketplace',
936
+ 'nightclub',
937
+ 'basics:icon-nightclub',
938
+ 'nursing_home',
939
+ 'basics:icon-nursinghome',
940
+ 'pharmacy',
941
+ 'basics:icon-pharmacy',
942
+ 'place_of_worship',
943
+ 'basics:icon-place_of_worship',
944
+ 'playground',
945
+ 'basics:icon-playground',
946
+ 'police',
947
+ 'basics:icon-police',
948
+ 'post_box',
949
+ 'basics:icon-postbox',
950
+ 'post_office',
951
+ 'basics:icon-post',
952
+ 'prison',
953
+ 'basics:icon-prison',
954
+ 'pub',
955
+ 'basics:icon-beer',
919
956
  //'public_building', 'basics:icon-public_building',
920
- 'recycling', 'basics:icon-recycling',
921
- 'restaurant', 'basics:icon-restaurant',
922
- 'school', 'basics:icon-school',
923
- 'shelter', 'basics:icon-shelter',
924
- 'telephone', 'basics:icon-telephone',
925
- 'theatre', 'basics:icon-theatre',
926
- 'toilets', 'basics:icon-toilet',
927
- 'townhall', 'basics:icon-town_hall',
957
+ 'recycling',
958
+ 'basics:icon-recycling',
959
+ 'restaurant',
960
+ 'basics:icon-restaurant',
961
+ 'school',
962
+ 'basics:icon-school',
963
+ 'shelter',
964
+ 'basics:icon-shelter',
965
+ 'telephone',
966
+ 'basics:icon-telephone',
967
+ 'theatre',
968
+ 'basics:icon-theatre',
969
+ 'toilets',
970
+ 'basics:icon-toilet',
971
+ 'townhall',
972
+ 'basics:icon-town_hall',
928
973
  //'university', 'basics:icon-university',
929
- 'vending_machine', 'basics:icon-vendingmachine',
930
- 'veterinary', 'basics:icon-veterinary',
931
- 'waste_basket', 'basics:icon-waste_basket',
974
+ 'vending_machine',
975
+ 'basics:icon-vendingmachine',
976
+ 'veterinary',
977
+ 'basics:icon-veterinary',
978
+ 'waste_basket',
979
+ 'basics:icon-waste_basket',
932
980
  '',
933
981
  ],
934
982
  },
935
983
  'poi-leisure': {
936
- image: ['match',
984
+ image: [
985
+ 'match',
937
986
  ['get', 'leisure'],
938
- 'golf_course', 'basics:icon-golf',
939
- 'ice_rink', 'basics:icon-icerink',
940
- 'pitch', 'basics:icon-pitch',
987
+ 'golf_course',
988
+ 'basics:icon-golf',
989
+ 'ice_rink',
990
+ 'basics:icon-icerink',
991
+ 'pitch',
992
+ 'basics:icon-pitch',
941
993
  //'sports_centre', 'basics:icon-sports_centre',
942
- 'stadium', 'basics:icon-stadium',
943
- 'swimming_pool', 'basics:icon-swimming',
944
- 'water_park', 'basics:icon-waterpark',
994
+ 'stadium',
995
+ 'basics:icon-stadium',
996
+ 'swimming_pool',
997
+ 'basics:icon-swimming',
998
+ 'water_park',
999
+ 'basics:icon-waterpark',
945
1000
  'basics:icon-sports',
946
1001
  ],
947
1002
  },
948
1003
  'poi-tourism': {
949
- image: ['match',
1004
+ image: [
1005
+ 'match',
950
1006
  ['get', 'tourism'],
951
1007
  //'alpine_hut', 'basics:icon-alpine_hut',
952
1008
  //'bed_and_breakfast', 'basics:icon-bed_and_breakfast',
953
1009
  //'camp_site', 'basics:icon-camp_site',
954
1010
  //'caravan_site', 'basics:icon-caravan_site',
955
- 'chalet', 'basics:icon-chalet',
1011
+ 'chalet',
1012
+ 'basics:icon-chalet',
956
1013
  //'guest_house', 'basics:icon-guest_house',
957
1014
  //'hostel', 'basics:icon-hostel',
958
1015
  //'hotel', 'basics:icon-hotel',
959
- 'information', 'basics:transport-information',
1016
+ 'information',
1017
+ 'basics:transport-information',
960
1018
  //'motel', 'basics:icon-motel',
961
- 'picnic_site', 'basics:icon-picnic_site',
1019
+ 'picnic_site',
1020
+ 'basics:icon-picnic_site',
962
1021
  //'theme_park', 'basics:icon-theme_park',
963
- 'viewpoint', 'basics:icon-viewpoint',
964
- 'zoo', 'basics:icon-zoo',
1022
+ 'viewpoint',
1023
+ 'basics:icon-viewpoint',
1024
+ 'zoo',
1025
+ 'basics:icon-zoo',
965
1026
  '',
966
1027
  ],
967
1028
  },
968
1029
  'poi-shop': {
969
- image: ['match',
1030
+ image: [
1031
+ 'match',
970
1032
  ['get', 'shop'],
971
- 'alcohol', 'basics:icon-alcohol_shop',
972
- 'bakery', 'basics:icon-bakery',
973
- 'beauty', 'basics:icon-beauty',
974
- 'beverages', 'basics:icon-beverages',
1033
+ 'alcohol',
1034
+ 'basics:icon-alcohol_shop',
1035
+ 'bakery',
1036
+ 'basics:icon-bakery',
1037
+ 'beauty',
1038
+ 'basics:icon-beauty',
1039
+ 'beverages',
1040
+ 'basics:icon-beverages',
975
1041
  //'bicycle', 'basics:icon-bicycle',
976
- 'books', 'basics:icon-books',
977
- 'butcher', 'basics:icon-butcher',
1042
+ 'books',
1043
+ 'basics:icon-books',
1044
+ 'butcher',
1045
+ 'basics:icon-butcher',
978
1046
  //'car', 'basics:icon-car',
979
- 'chemist', 'basics:icon-chemist',
980
- 'clothes', 'basics:icon-clothes',
1047
+ 'chemist',
1048
+ 'basics:icon-chemist',
1049
+ 'clothes',
1050
+ 'basics:icon-clothes',
981
1051
  //'computer', 'basics:icon-computer',
982
1052
  //'convinience', 'basics:icon-convinience',
983
1053
  //'department_store', 'basics:icon-department_store',
984
- 'doityourself', 'basics:icon-doityourself',
985
- 'dry_cleaning', 'basics:icon-drycleaning',
986
- 'florist', 'basics:icon-florist',
987
- 'furniture', 'basics:icon-furniture',
988
- 'garden_centre', 'basics:icon-garden_centre',
989
- 'general', 'basics:icon-shop',
990
- 'gift', 'basics:icon-gift',
991
- 'greengrocer', 'basics:icon-greengrocer',
992
- 'hairdresser', 'basics:icon-hairdresser',
993
- 'hardware', 'basics:icon-hardware',
994
- 'jewelry', 'basics:icon-jewelry_store',
995
- 'kiosk', 'basics:icon-kiosk',
996
- 'laundry', 'basics:icon-laundry',
1054
+ 'doityourself',
1055
+ 'basics:icon-doityourself',
1056
+ 'dry_cleaning',
1057
+ 'basics:icon-drycleaning',
1058
+ 'florist',
1059
+ 'basics:icon-florist',
1060
+ 'furniture',
1061
+ 'basics:icon-furniture',
1062
+ 'garden_centre',
1063
+ 'basics:icon-garden_centre',
1064
+ 'general',
1065
+ 'basics:icon-shop',
1066
+ 'gift',
1067
+ 'basics:icon-gift',
1068
+ 'greengrocer',
1069
+ 'basics:icon-greengrocer',
1070
+ 'hairdresser',
1071
+ 'basics:icon-hairdresser',
1072
+ 'hardware',
1073
+ 'basics:icon-hardware',
1074
+ 'jewelry',
1075
+ 'basics:icon-jewelry_store',
1076
+ 'kiosk',
1077
+ 'basics:icon-kiosk',
1078
+ 'laundry',
1079
+ 'basics:icon-laundry',
997
1080
  //'mall', 'basics:icon-mall',
998
1081
  //'mobile_phone', 'basics:icon-mobile_phone',
999
- 'newsagent', 'basics:icon-newsagent',
1000
- 'optican', 'basics:icon-optician',
1001
- 'outdoor', 'basics:icon-outdoor',
1002
- 'shoes', 'basics:icon-shoes',
1003
- 'sports', 'basics:icon-sports',
1004
- 'stationery', 'basics:icon-stationery',
1082
+ 'newsagent',
1083
+ 'basics:icon-newsagent',
1084
+ 'optican',
1085
+ 'basics:icon-optician',
1086
+ 'outdoor',
1087
+ 'basics:icon-outdoor',
1088
+ 'shoes',
1089
+ 'basics:icon-shoes',
1090
+ 'sports',
1091
+ 'basics:icon-sports',
1092
+ 'stationery',
1093
+ 'basics:icon-stationery',
1005
1094
  //'supermarket', 'basics:icon-supermarket',
1006
- 'toys', 'basics:icon-toys',
1007
- 'travel_agency', 'basics:icon-travel_agent',
1008
- 'video', 'basics:icon-video',
1095
+ 'toys',
1096
+ 'basics:icon-toys',
1097
+ 'travel_agency',
1098
+ 'basics:icon-travel_agent',
1099
+ 'video',
1100
+ 'basics:icon-video',
1009
1101
  'basics:icon-shop',
1010
1102
  ],
1011
1103
  },
1012
1104
  'poi-man_made': {
1013
- image: ['match',
1105
+ image: [
1106
+ 'match',
1014
1107
  ['get', 'man_made'],
1015
- 'lighthouse', 'basics:icon-lighthouse',
1016
- 'surveillance', 'basics:icon-surveillance',
1017
- 'tower', 'basics:icon-observation_tower',
1108
+ 'lighthouse',
1109
+ 'basics:icon-lighthouse',
1110
+ 'surveillance',
1111
+ 'basics:icon-surveillance',
1112
+ 'tower',
1113
+ 'basics:icon-observation_tower',
1018
1114
  //'wastewater_plant', 'basics:icon-wastewater_plant',
1019
1115
  //'water_well', 'basics:icon-water_well',
1020
1116
  //'water_works', 'basics:icon-water_works',
1021
- 'watermill', 'basics:icon-watermill',
1022
- 'windmill', 'basics:icon-windmill',
1117
+ 'watermill',
1118
+ 'basics:icon-watermill',
1119
+ 'windmill',
1120
+ 'basics:icon-windmill',
1023
1121
  '',
1024
1122
  ],
1025
1123
  },
1026
1124
  'poi-historic': {
1027
- image: ['match',
1125
+ image: [
1126
+ 'match',
1028
1127
  ['get', 'historic'],
1029
1128
  //'archaelogical_site', 'basics:icon-archaelogical_site',
1030
- 'artwork', 'basics:icon-artwork',
1129
+ 'artwork',
1130
+ 'basics:icon-artwork',
1031
1131
  //'battlefield', 'basics:icon-battlefield',
1032
- 'castle', 'basics:icon-castle',
1132
+ 'castle',
1133
+ 'basics:icon-castle',
1033
1134
  //'fort', 'basics:icon-fort',
1034
1135
  //'memorial', 'basics:icon-memorial',
1035
- 'monument', 'basics:icon-monument',
1136
+ 'monument',
1137
+ 'basics:icon-monument',
1036
1138
  //'ruins', 'basics:icon-ruins',
1037
1139
  //'wayside_cross', 'basics:icon-wayside_cross',
1038
- 'wayside_shrine', 'basics:icon-shrine',
1140
+ 'wayside_shrine',
1141
+ 'basics:icon-shrine',
1039
1142
  'basics:icon-historic',
1040
1143
  ],
1041
1144
  },
1042
1145
  'poi-emergency': {
1043
- image: ['match',
1146
+ image: [
1147
+ 'match',
1044
1148
  ['get', 'emergency'],
1045
- 'defibrillator', 'basics:icon-defibrillator',
1046
- 'fire_hydrant', 'basics:icon-hydrant',
1047
- 'phone', 'basics:icon-emergency_phone',
1149
+ 'defibrillator',
1150
+ 'basics:icon-defibrillator',
1151
+ 'fire_hydrant',
1152
+ 'basics:icon-hydrant',
1153
+ 'phone',
1154
+ 'basics:icon-emergency_phone',
1048
1155
  '',
1049
1156
  ],
1050
1157
  },
@@ -6,6 +6,6 @@ export default class Eclipse extends Colorful {
6
6
  public constructor() {
7
7
  super();
8
8
 
9
- this.transformDefaultColors(color => color.invertLuminosity());
9
+ this.transformDefaultColors((color) => color.invertLuminosity());
10
10
  }
11
11
  }
@@ -7,4 +7,4 @@ export default class Empty extends Colorful {
7
7
  protected getStyleRules(_options: StyleRulesOptions): StyleRules {
8
8
  return {};
9
9
  }
10
- }
10
+ }
@@ -6,6 +6,6 @@ export default class Graybeard extends Colorful {
6
6
  public constructor() {
7
7
  super();
8
8
 
9
- this.transformDefaultColors(color => color.saturate(-1));
9
+ this.transformDefaultColors((color) => color.saturate(-1));
10
10
  }
11
- }
11
+ }
@@ -2,8 +2,6 @@ import type { StyleBuilder } from '../style_builder/style_builder.js';
2
2
  import type { StyleBuilderOptions } from '../style_builder/types.js';
3
3
  import { StyleSpecification } from '@maplibre/maplibre-gl-style-spec';
4
4
 
5
-
6
-
7
5
  // import styles
8
6
  import Colorful from './colorful.js';
9
7
  import Eclipse from './eclipse.js';
@@ -25,7 +23,6 @@ function getStyleBuilder(styleBuilder: new () => StyleBuilder): StyleBuilderFunc
25
23
  return fn;
26
24
  }
27
25
 
28
-
29
26
  // generate style builders
30
27
  export const colorful = getStyleBuilder(Colorful);
31
28
  export const eclipse = getStyleBuilder(Eclipse);
@@ -10,7 +10,6 @@ export default class Neutrino extends Colorful {
10
10
  };
11
11
 
12
12
  public defaultColors: StyleBuilderColors = {
13
-
14
13
  /** Color representing land areas. */
15
14
  land: '#f6f0f6',
16
15
 
@@ -79,11 +78,10 @@ export default class Neutrino extends Colorful {
79
78
  wetland: '#000',
80
79
  };
81
80
 
82
-
83
81
  protected getStyleRules(options: StyleRulesOptions): StyleRules {
84
82
  const { colors, fonts } = options;
85
83
  return {
86
- 'background': {
84
+ background: {
87
85
  color: colors.land,
88
86
  },
89
87
  'boundary-{country,state}': {
@@ -154,11 +152,11 @@ export default class Neutrino extends Colorful {
154
152
  'site-{bicycleparking,parking}': {
155
153
  color: colors.commercial,
156
154
  },
157
- 'building': {
155
+ building: {
158
156
  color: colors.building,
159
157
  opacity: { 14: 0, 15: 1 },
160
158
  },
161
- 'bridge': {
159
+ bridge: {
162
160
  color: colors.land.darken(0.01),
163
161
  },
164
162
  '{tunnel-,bridge-,}street-*': {
@@ -246,14 +244,16 @@ export default class Neutrino extends Colorful {
246
244
  },
247
245
 
248
246
  // minor streets
249
- '{bridge-street,tunnel-street,street}-{tertiary,tertiary-link,unclassified,residential,living_street,pedestrian}:outline': {
250
- size: { 12: 2, 14: 3, 16: 6, 18: 26, 19: 64, 20: 128 },
251
- opacity: { 12: 0, 13: 1 },
252
- },
253
- '{bridge-street,tunnel-street,street}-{tertiary,tertiary-link,unclassified,residential,living_street,pedestrian}': {
254
- size: { 12: 1, 14: 2, 16: 5, 18: 24, 19: 60, 20: 120 },
255
- opacity: { 12: 0, 13: 1 },
256
- },
247
+ '{bridge-street,tunnel-street,street}-{tertiary,tertiary-link,unclassified,residential,living_street,pedestrian}:outline':
248
+ {
249
+ size: { 12: 2, 14: 3, 16: 6, 18: 26, 19: 64, 20: 128 },
250
+ opacity: { 12: 0, 13: 1 },
251
+ },
252
+ '{bridge-street,tunnel-street,street}-{tertiary,tertiary-link,unclassified,residential,living_street,pedestrian}':
253
+ {
254
+ size: { 12: 1, 14: 2, 16: 5, 18: 24, 19: 60, 20: 120 },
255
+ opacity: { 12: 0, 13: 1 },
256
+ },
257
257
  // service and tracks
258
258
  '{bridge-street,tunnel-street,street}-{service,track}:outline': {
259
259
  size: { 14: 2, 16: 4, 18: 18, 19: 48, 20: 96 },
@@ -411,7 +411,6 @@ export default class Neutrino extends Colorful {
411
411
  size: { 14: 8, 18: 10, 20: 16 },
412
412
  },
413
413
 
414
-
415
414
  'label-street-*': {
416
415
  color: colors.label,
417
416
  font: fonts.regular,
@@ -423,7 +422,6 @@ export default class Neutrino extends Colorful {
423
422
  minzoom: 12,
424
423
  size: { 12: 10, 15: 13 },
425
424
  },
426
-
427
425
  };
428
426
  }
429
- }
427
+ }
@@ -6,6 +6,6 @@ export default class Shadow extends Colorful {
6
6
  public constructor() {
7
7
  super();
8
8
 
9
- this.transformDefaultColors(color => color.saturate(-1).invert().brightness(0.2));
9
+ this.transformDefaultColors((color) => color.saturate(-1).invert().brightness(0.2));
10
10
  }
11
- }
11
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  export type { MaplibreLayerDefinition, MaplibreLayer } from './maplibre.js';
3
2
  export type { VectorLayer } from './vector_layer.js';
4
3
  export { isTileJSONSpecification } from './tilejson.js';
@@ -1,11 +1,25 @@
1
- import type { BackgroundLayerSpecification, FillLayerSpecification, FilterSpecification, LineLayerSpecification, SymbolLayerSpecification } from '@maplibre/maplibre-gl-style-spec';
1
+ import type {
2
+ BackgroundLayerSpecification,
3
+ FillLayerSpecification,
4
+ FilterSpecification,
5
+ LineLayerSpecification,
6
+ SymbolLayerSpecification,
7
+ } from '@maplibre/maplibre-gl-style-spec';
2
8
  export type { StyleSpecification } from '@maplibre/maplibre-gl-style-spec';
3
9
 
4
10
  /** Type for Maplibre layers, including background, fill, line, and symbol specifications. */
5
- export type MaplibreLayer = BackgroundLayerSpecification | FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification;
11
+ export type MaplibreLayer =
12
+ | BackgroundLayerSpecification
13
+ | FillLayerSpecification
14
+ | LineLayerSpecification
15
+ | SymbolLayerSpecification;
6
16
 
7
17
  /** Defines the structure of Maplibre layer definitions, omitting the 'source' property for fill, line, and symbol specifications. */
8
- export type MaplibreLayerDefinition = BackgroundLayerSpecification | Omit<FillLayerSpecification, 'source'> | Omit<LineLayerSpecification, 'source'> | Omit<SymbolLayerSpecification, 'source'>;
18
+ export type MaplibreLayerDefinition =
19
+ | BackgroundLayerSpecification
20
+ | Omit<FillLayerSpecification, 'source'>
21
+ | Omit<LineLayerSpecification, 'source'>
22
+ | Omit<SymbolLayerSpecification, 'source'>;
9
23
 
10
24
  /** Represents a filter specification in Maplibre styles. */
11
25
  export type MaplibreFilter = FilterSpecification;