@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.
- package/README.md +14 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +570 -333
- package/dist/index.js.map +1 -1
- package/package.json +13 -8
- package/src/color/abstract.ts +1 -1
- package/src/color/hsl.test.ts +10 -16
- package/src/color/hsl.ts +11 -15
- package/src/color/hsv.test.ts +4 -10
- package/src/color/hsv.ts +38 -22
- package/src/color/index.test.ts +2 -4
- package/src/color/index.ts +1 -1
- package/src/color/random.test.ts +1 -1
- package/src/color/random.ts +127 -25
- package/src/color/rgb.test.ts +55 -36
- package/src/color/rgb.ts +35 -48
- package/src/color/utils.test.ts +4 -6
- package/src/color/utils.ts +1 -3
- package/src/guess_style/guess_style.test.ts +49 -43
- package/src/guess_style/guess_style.ts +64 -21
- package/src/guess_style/index.ts +0 -1
- package/src/index.test.ts +34 -7
- package/src/index.ts +29 -19
- package/src/lib/utils.test.ts +2 -2
- package/src/lib/utils.ts +2 -1
- package/src/shortbread/index.ts +0 -1
- package/src/shortbread/layers.test.ts +19 -3
- package/src/shortbread/layers.ts +204 -194
- package/src/shortbread/properties.test.ts +3 -4
- package/src/shortbread/properties.ts +18 -4
- package/src/shortbread/template.test.ts +7 -2
- package/src/shortbread/template.ts +7 -14
- package/src/style_builder/decorator.test.ts +4 -4
- package/src/style_builder/decorator.ts +29 -21
- package/src/style_builder/recolor.test.ts +6 -31
- package/src/style_builder/recolor.ts +20 -20
- package/src/style_builder/style_builder.test.ts +50 -13
- package/src/style_builder/style_builder.ts +29 -31
- package/src/style_builder/types.ts +85 -2
- package/src/styles/LICENSE.md +15 -15
- package/src/styles/colorful.test.ts +91 -0
- package/src/styles/colorful.ts +229 -122
- package/src/styles/eclipse.ts +1 -1
- package/src/styles/empty.ts +1 -1
- package/src/styles/graybeard.ts +2 -2
- package/src/styles/index.ts +0 -3
- package/src/styles/neutrino.ts +14 -16
- package/src/styles/shadow.ts +2 -2
- package/src/types/index.ts +0 -1
- package/src/types/maplibre.ts +17 -3
- package/src/types/tilejson.test.ts +8 -5
- package/src/types/tilejson.ts +13 -13
- package/src/types/vector_layer.test.ts +4 -1
- package/src/types/vector_layer.ts +7 -7
package/src/styles/colorful.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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: [
|
|
876
|
+
image: [
|
|
877
|
+
'match',
|
|
878
878
|
['get', 'amenity'],
|
|
879
|
-
'arts_centre',
|
|
880
|
-
'
|
|
881
|
-
'
|
|
882
|
-
'
|
|
883
|
-
'
|
|
884
|
-
'
|
|
885
|
-
'
|
|
886
|
-
'
|
|
887
|
-
'
|
|
888
|
-
'
|
|
889
|
-
'
|
|
890
|
-
'
|
|
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',
|
|
893
|
-
'
|
|
904
|
+
'college',
|
|
905
|
+
'basics:icon-college',
|
|
906
|
+
'community_centre',
|
|
907
|
+
'basics:icon-community',
|
|
894
908
|
//'courthouse', 'basics:icon-courthouse',
|
|
895
|
-
'dentist',
|
|
896
|
-
'
|
|
897
|
-
'
|
|
898
|
-
'
|
|
899
|
-
'
|
|
900
|
-
'
|
|
901
|
-
'
|
|
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',
|
|
904
|
-
'
|
|
905
|
-
'
|
|
906
|
-
'
|
|
907
|
-
'
|
|
908
|
-
'
|
|
909
|
-
'
|
|
910
|
-
'
|
|
911
|
-
'
|
|
912
|
-
'
|
|
913
|
-
'
|
|
914
|
-
'
|
|
915
|
-
'
|
|
916
|
-
'
|
|
917
|
-
'
|
|
918
|
-
'
|
|
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',
|
|
921
|
-
'
|
|
922
|
-
'
|
|
923
|
-
'
|
|
924
|
-
'
|
|
925
|
-
'
|
|
926
|
-
'
|
|
927
|
-
'
|
|
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',
|
|
930
|
-
'
|
|
931
|
-
'
|
|
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: [
|
|
984
|
+
image: [
|
|
985
|
+
'match',
|
|
937
986
|
['get', 'leisure'],
|
|
938
|
-
'golf_course',
|
|
939
|
-
'
|
|
940
|
-
'
|
|
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',
|
|
943
|
-
'
|
|
944
|
-
'
|
|
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: [
|
|
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',
|
|
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',
|
|
1016
|
+
'information',
|
|
1017
|
+
'basics:transport-information',
|
|
960
1018
|
//'motel', 'basics:icon-motel',
|
|
961
|
-
'picnic_site',
|
|
1019
|
+
'picnic_site',
|
|
1020
|
+
'basics:icon-picnic_site',
|
|
962
1021
|
//'theme_park', 'basics:icon-theme_park',
|
|
963
|
-
'viewpoint',
|
|
964
|
-
'
|
|
1022
|
+
'viewpoint',
|
|
1023
|
+
'basics:icon-viewpoint',
|
|
1024
|
+
'zoo',
|
|
1025
|
+
'basics:icon-zoo',
|
|
965
1026
|
'',
|
|
966
1027
|
],
|
|
967
1028
|
},
|
|
968
1029
|
'poi-shop': {
|
|
969
|
-
image: [
|
|
1030
|
+
image: [
|
|
1031
|
+
'match',
|
|
970
1032
|
['get', 'shop'],
|
|
971
|
-
'alcohol',
|
|
972
|
-
'
|
|
973
|
-
'
|
|
974
|
-
'
|
|
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',
|
|
977
|
-
'
|
|
1042
|
+
'books',
|
|
1043
|
+
'basics:icon-books',
|
|
1044
|
+
'butcher',
|
|
1045
|
+
'basics:icon-butcher',
|
|
978
1046
|
//'car', 'basics:icon-car',
|
|
979
|
-
'chemist',
|
|
980
|
-
'
|
|
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',
|
|
985
|
-
'
|
|
986
|
-
'
|
|
987
|
-
'
|
|
988
|
-
'
|
|
989
|
-
'
|
|
990
|
-
'
|
|
991
|
-
'
|
|
992
|
-
'
|
|
993
|
-
'
|
|
994
|
-
'
|
|
995
|
-
'
|
|
996
|
-
'
|
|
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',
|
|
1000
|
-
'
|
|
1001
|
-
'
|
|
1002
|
-
'
|
|
1003
|
-
'
|
|
1004
|
-
'
|
|
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',
|
|
1007
|
-
'
|
|
1008
|
-
'
|
|
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: [
|
|
1105
|
+
image: [
|
|
1106
|
+
'match',
|
|
1014
1107
|
['get', 'man_made'],
|
|
1015
|
-
'lighthouse',
|
|
1016
|
-
'
|
|
1017
|
-
'
|
|
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',
|
|
1022
|
-
'
|
|
1117
|
+
'watermill',
|
|
1118
|
+
'basics:icon-watermill',
|
|
1119
|
+
'windmill',
|
|
1120
|
+
'basics:icon-windmill',
|
|
1023
1121
|
'',
|
|
1024
1122
|
],
|
|
1025
1123
|
},
|
|
1026
1124
|
'poi-historic': {
|
|
1027
|
-
image: [
|
|
1125
|
+
image: [
|
|
1126
|
+
'match',
|
|
1028
1127
|
['get', 'historic'],
|
|
1029
1128
|
//'archaelogical_site', 'basics:icon-archaelogical_site',
|
|
1030
|
-
'artwork',
|
|
1129
|
+
'artwork',
|
|
1130
|
+
'basics:icon-artwork',
|
|
1031
1131
|
//'battlefield', 'basics:icon-battlefield',
|
|
1032
|
-
'castle',
|
|
1132
|
+
'castle',
|
|
1133
|
+
'basics:icon-castle',
|
|
1033
1134
|
//'fort', 'basics:icon-fort',
|
|
1034
1135
|
//'memorial', 'basics:icon-memorial',
|
|
1035
|
-
'monument',
|
|
1136
|
+
'monument',
|
|
1137
|
+
'basics:icon-monument',
|
|
1036
1138
|
//'ruins', 'basics:icon-ruins',
|
|
1037
1139
|
//'wayside_cross', 'basics:icon-wayside_cross',
|
|
1038
|
-
'wayside_shrine',
|
|
1140
|
+
'wayside_shrine',
|
|
1141
|
+
'basics:icon-shrine',
|
|
1039
1142
|
'basics:icon-historic',
|
|
1040
1143
|
],
|
|
1041
1144
|
},
|
|
1042
1145
|
'poi-emergency': {
|
|
1043
|
-
image: [
|
|
1146
|
+
image: [
|
|
1147
|
+
'match',
|
|
1044
1148
|
['get', 'emergency'],
|
|
1045
|
-
'defibrillator',
|
|
1046
|
-
'
|
|
1047
|
-
'
|
|
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
|
},
|
package/src/styles/eclipse.ts
CHANGED
package/src/styles/empty.ts
CHANGED
package/src/styles/graybeard.ts
CHANGED
package/src/styles/index.ts
CHANGED
|
@@ -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);
|
package/src/styles/neutrino.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
155
|
+
building: {
|
|
158
156
|
color: colors.building,
|
|
159
157
|
opacity: { 14: 0, 15: 1 },
|
|
160
158
|
},
|
|
161
|
-
|
|
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
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
+
}
|
package/src/styles/shadow.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/types/index.ts
CHANGED
package/src/types/maplibre.ts
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import type {
|
|
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 =
|
|
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 =
|
|
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;
|