@furkot/garmin-data 2.1.1 → 3.0.0
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 +2 -2
- package/lib/garmin.js +214 -214
- package/lib/index.js +21 -27
- package/package.json +10 -9
- package/sprite/24x24.css +801 -801
- package/sprite/48x48.css +801 -801
- package/index.js +0 -1
package/Readme.md
CHANGED
|
@@ -17,7 +17,7 @@ $ npm install --save @furkot/garmin-data
|
|
|
17
17
|
Furkot pin symbols are characters in [furkot-icon-font] - see [here][furkot-icon-font-demo].
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
|
|
20
|
+
import data from '@furkot/garmin-data';
|
|
21
21
|
|
|
22
22
|
console.log(data.toFurkot['Church']); // === 34
|
|
23
23
|
console.log(data.toGarmin['34']); // === 'Church'
|
|
@@ -36,7 +36,7 @@ MIT © [Damian Krzeminski](https://code42day.com)
|
|
|
36
36
|
[npm-url]: https://npmjs.org/package/@furkot/garmin-data
|
|
37
37
|
|
|
38
38
|
[build-url]: https://github.com/furkot/garmin-data/actions/workflows/check.yaml
|
|
39
|
-
[build-image]: https://img.shields.io/github/workflow/status/furkot/garmin-data/check
|
|
39
|
+
[build-image]: https://img.shields.io/github/actions/workflow/status/furkot/garmin-data/check.yaml?branch=main
|
|
40
40
|
|
|
41
41
|
[deps-image]: https://img.shields.io/librariesio/release/npm/@furkot/garmin-data
|
|
42
42
|
[deps-url]: https://libraries.io/npm/@furkot%2Fgarmin-data
|
package/lib/garmin.js
CHANGED
|
@@ -1,225 +1,225 @@
|
|
|
1
|
-
|
|
1
|
+
export default {
|
|
2
2
|
toGarmin: {
|
|
3
|
-
0: 'Lodging',
|
|
4
|
-
1: 'Flag, Blue',
|
|
5
|
-
2: 'Trail Head',
|
|
6
|
-
3: 'Trail Head',
|
|
7
|
-
4: 'Trail Head',
|
|
8
|
-
5: 'Library',
|
|
9
|
-
6: 'Bank',
|
|
10
|
-
7: 'Pin, Blue',
|
|
11
|
-
8: 'Bike Trail',
|
|
12
|
-
9: 'Picnic Area',
|
|
13
|
-
10: 'Gas Station',
|
|
14
|
-
11: 'Campground',
|
|
15
|
-
12: 'Residence',
|
|
16
|
-
13: 'Summit',
|
|
17
|
-
14: 'Ski Resort',
|
|
18
|
-
15: 'Lodging',
|
|
19
|
-
16: 'Lodging',
|
|
20
|
-
17: 'Car',
|
|
21
|
-
18: 'Flag, Blue',
|
|
22
|
-
19: 'Flag, Blue',
|
|
23
|
-
|
|
24
|
-
21: 'Diver Down Flag 1',
|
|
25
|
-
22: 'Flag, Blue',
|
|
26
|
-
23: 'Airport',
|
|
27
|
-
24: 'Restaurant',
|
|
28
|
-
25: 'Gas Station',
|
|
29
|
-
26: 'Bike Trail',
|
|
30
|
-
27: 'Food Source',
|
|
31
|
-
28: 'Bar',
|
|
32
|
-
29: 'Amusement Park',
|
|
33
|
-
30: 'Winery',
|
|
34
|
-
31: 'Bar',
|
|
35
|
-
32: 'Shopping Center',
|
|
36
|
-
33: 'Museum',
|
|
37
|
-
34: 'Church',
|
|
38
|
-
35: 'Church',
|
|
39
|
-
36: 'Ghost Town',
|
|
40
|
-
37: 'Residence',
|
|
41
|
-
38: 'Building',
|
|
42
|
-
39: 'Museum',
|
|
43
|
-
40: 'Building',
|
|
44
|
-
41: 'City Hall',
|
|
45
|
-
42: 'Church',
|
|
46
|
-
43: 'Tall Tower',
|
|
47
|
-
44: 'Church',
|
|
48
|
-
45: 'Museum',
|
|
49
|
-
46: 'Building',
|
|
50
|
-
47: 'Museum',
|
|
51
|
-
48: 'Forest',
|
|
52
|
-
49: 'Swimming Area',
|
|
53
|
-
50: 'Park',
|
|
54
|
-
51: 'Building',
|
|
55
|
-
52: 'Summit',
|
|
56
|
-
53: 'Park',
|
|
57
|
-
54: 'Swimming Area',
|
|
58
|
-
55: 'Mile Marker',
|
|
59
|
-
56: 'Beach',
|
|
60
|
-
57: 'Water Source',
|
|
61
|
-
58: 'Dropoff',
|
|
62
|
-
59: 'Summit',
|
|
63
|
-
60: 'Summit',
|
|
64
|
-
61: 'Scenic Area',
|
|
65
|
-
62: 'Weed Bed',
|
|
66
|
-
63: 'Fishing Area',
|
|
67
|
-
64: 'ATV',
|
|
68
|
-
65: 'Cemetery',
|
|
69
|
-
66: 'Library',
|
|
70
|
-
67: 'Zoo',
|
|
71
|
-
68: 'Stadium',
|
|
72
|
-
69: 'Short Tower',
|
|
73
|
-
70: 'Square, Green',
|
|
74
|
-
71: 'City (Medium)',
|
|
75
|
-
72: 'Block, Green',
|
|
76
|
-
73: 'Information',
|
|
77
|
-
74: 'Diamond, Green',
|
|
78
|
-
75: 'Scenic Area',
|
|
79
|
-
|
|
80
|
-
77: 'Drinking Water',
|
|
81
|
-
78: 'Convenience Store',
|
|
82
|
-
79: 'Anchor',
|
|
83
|
-
80: 'Toll Booth',
|
|
84
|
-
81: 'Medical Facility',
|
|
85
|
-
82: 'Restroom',
|
|
86
|
-
83: 'Truck Stop',
|
|
87
|
-
84: 'RV Park',
|
|
88
|
-
85: 'Bridge',
|
|
89
|
-
86: 'Favorite',
|
|
90
|
-
87: 'Geocache',
|
|
91
|
-
88: 'Parachute Area',
|
|
92
|
-
89: 'Circle with X',
|
|
93
|
-
90: 'Restaurant',
|
|
94
|
-
91: 'ATV',
|
|
95
|
-
92: 'Dog Running',
|
|
96
|
-
93: 'Triangle, Red',
|
|
97
|
-
94: 'Bait and Tackle',
|
|
98
|
-
95: 'Ferry',
|
|
99
|
-
96: 'Live Theater',
|
|
100
|
-
97: 'Railway',
|
|
101
|
-
98: 'Parking Area',
|
|
102
|
-
99: 'Shopping Center',
|
|
103
|
-
100: 'Boat Ramp',
|
|
104
|
-
101: 'Covey',
|
|
105
|
-
|
|
106
|
-
103: 'Movie Theater',
|
|
107
|
-
104: 'Horn',
|
|
108
|
-
105: 'Contact, Clown',
|
|
3
|
+
0: 'Lodging', // hotel
|
|
4
|
+
1: 'Flag, Blue', // stop (default)
|
|
5
|
+
2: 'Trail Head', // hiking
|
|
6
|
+
3: 'Trail Head', // guide
|
|
7
|
+
4: 'Trail Head', // snowshoeing
|
|
8
|
+
5: 'Library', // book
|
|
9
|
+
6: 'Bank', // deal
|
|
10
|
+
7: 'Pin, Blue', // pin
|
|
11
|
+
8: 'Bike Trail', // biking
|
|
12
|
+
9: 'Picnic Area', // picnic
|
|
13
|
+
10: 'Gas Station', // charging
|
|
14
|
+
11: 'Campground', // tent
|
|
15
|
+
12: 'Residence', // house
|
|
16
|
+
13: 'Summit', // climbing
|
|
17
|
+
14: 'Ski Resort', // skiing
|
|
18
|
+
15: 'Lodging', // hostel
|
|
19
|
+
16: 'Lodging', // chain
|
|
20
|
+
17: 'Car', // car
|
|
21
|
+
18: 'Flag, Blue', // first
|
|
22
|
+
19: 'Flag, Blue', // last
|
|
23
|
+
//20: '', // UNUSED
|
|
24
|
+
21: 'Diver Down Flag 1', // diving
|
|
25
|
+
22: 'Flag, Blue', // firstlast
|
|
26
|
+
23: 'Airport', // airplane
|
|
27
|
+
24: 'Restaurant', // restaurant
|
|
28
|
+
25: 'Gas Station', // fillingstation
|
|
29
|
+
26: 'Bike Trail', // motorcycle
|
|
30
|
+
27: 'Food Source', // farmstand
|
|
31
|
+
28: 'Bar', // brewery
|
|
32
|
+
29: 'Amusement Park', // amusementpark
|
|
33
|
+
30: 'Winery', // wine
|
|
34
|
+
31: 'Bar', // bar
|
|
35
|
+
32: 'Shopping Center', // grocery
|
|
36
|
+
33: 'Museum', // museum
|
|
37
|
+
34: 'Church', // church
|
|
38
|
+
35: 'Church', // synagogue
|
|
39
|
+
36: 'Ghost Town', // ruins
|
|
40
|
+
37: 'Residence', // villa
|
|
41
|
+
38: 'Building', // palace
|
|
42
|
+
39: 'Museum', // artmuseum
|
|
43
|
+
40: 'Building', // worldheritagesite
|
|
44
|
+
41: 'City Hall', // town_hall
|
|
45
|
+
42: 'Church', // shrine
|
|
46
|
+
43: 'Tall Tower', // tower
|
|
47
|
+
44: 'Church', // temple
|
|
48
|
+
45: 'Museum', // sciencemuseum
|
|
49
|
+
46: 'Building', // landmark
|
|
50
|
+
47: 'Museum', // historymuseum
|
|
51
|
+
48: 'Forest', // forest
|
|
52
|
+
49: 'Swimming Area', // surfing
|
|
53
|
+
50: 'Park', // park
|
|
54
|
+
51: 'Building', // structure
|
|
55
|
+
52: 'Summit', // naturalfeature
|
|
56
|
+
53: 'Park', // outdoors
|
|
57
|
+
54: 'Swimming Area', // watersport
|
|
58
|
+
55: 'Mile Marker', // scenicroad
|
|
59
|
+
56: 'Beach', // beach
|
|
60
|
+
57: 'Water Source', // hotspring
|
|
61
|
+
58: 'Dropoff', // water
|
|
62
|
+
59: 'Summit', // mountains
|
|
63
|
+
60: 'Summit', // volcano
|
|
64
|
+
61: 'Scenic Area', // lookout
|
|
65
|
+
62: 'Weed Bed', // lake
|
|
66
|
+
63: 'Fishing Area', // river
|
|
67
|
+
64: 'ATV', // jeep
|
|
68
|
+
65: 'Cemetery', // cemetery
|
|
69
|
+
66: 'Library', // library
|
|
70
|
+
67: 'Zoo', // zoo
|
|
71
|
+
68: 'Stadium', // stadium
|
|
72
|
+
69: 'Short Tower', // windmill
|
|
73
|
+
70: 'Square, Green', // square
|
|
74
|
+
71: 'City (Medium)', // town
|
|
75
|
+
72: 'Block, Green', // statue
|
|
76
|
+
73: 'Information', // information
|
|
77
|
+
74: 'Diamond, Green', // amphitheater
|
|
78
|
+
75: 'Scenic Area', // observatory
|
|
79
|
+
//76: '', // passthru
|
|
80
|
+
77: 'Drinking Water', // tap
|
|
81
|
+
78: 'Convenience Store', // minimarket
|
|
82
|
+
79: 'Anchor', // anchor
|
|
83
|
+
80: 'Toll Booth', // tollbooth
|
|
84
|
+
81: 'Medical Facility', // hospital
|
|
85
|
+
82: 'Restroom', // toilets
|
|
86
|
+
83: 'Truck Stop', // truck
|
|
87
|
+
84: 'RV Park', // rvpark
|
|
88
|
+
85: 'Bridge', // bridge
|
|
89
|
+
86: 'Favorite', // star
|
|
90
|
+
87: 'Geocache', // treasure
|
|
91
|
+
88: 'Parachute Area', // teleport
|
|
92
|
+
89: 'Circle with X', // railroadcrossing
|
|
93
|
+
90: 'Restaurant', // coffee
|
|
94
|
+
91: 'ATV', // atv
|
|
95
|
+
92: 'Dog Running', // pets
|
|
96
|
+
93: 'Triangle, Red', // fire
|
|
97
|
+
94: 'Bait and Tackle', // pier
|
|
98
|
+
95: 'Ferry', // ferry
|
|
99
|
+
96: 'Live Theater', // theater
|
|
100
|
+
97: 'Railway', // train
|
|
101
|
+
98: 'Parking Area', // parking
|
|
102
|
+
99: 'Shopping Center', // cart
|
|
103
|
+
100: 'Boat Ramp', // boatramp
|
|
104
|
+
101: 'Covey', // bird
|
|
105
|
+
//102: '', // UNUSED
|
|
106
|
+
103: 'Movie Theater', // film
|
|
107
|
+
104: 'Horn', // music
|
|
108
|
+
105: 'Contact, Clown', // entertain
|
|
109
109
|
106: 'Ground Transportation', // bus
|
|
110
110
|
107: 'Ground Transportation', // taxi
|
|
111
|
-
108: 'ATV',
|
|
112
|
-
109: 'Dam',
|
|
113
|
-
110: 'Skull and Crossbones',
|
|
114
|
-
111: 'City Hall',
|
|
115
|
-
112: 'Geocache Found',
|
|
116
|
-
113: 'Contact, Blonde',
|
|
117
|
-
114: 'Favorite',
|
|
118
|
-
115: 'Oil Field',
|
|
119
|
-
116: 'Contact, Smiley',
|
|
120
|
-
117: 'Radio Beacon',
|
|
121
|
-
|
|
122
|
-
119: 'Fitness Center',
|
|
123
|
-
120: 'Police Station',
|
|
124
|
-
121: 'Police Station',
|
|
125
|
-
122: 'Restricted Area',
|
|
126
|
-
123: 'Contact, Alien',
|
|
127
|
-
124: 'School',
|
|
128
|
-
125: 'Lodge',
|
|
129
|
-
126: 'Rectangle, Blue',
|
|
130
|
-
127: 'Dog Sitting',
|
|
131
|
-
128: 'Sad Face',
|
|
132
|
-
129: 'Levee',
|
|
133
|
-
130: 'Circle, Green',
|
|
134
|
-
131: 'Golf Course',
|
|
135
|
-
132: 'Post Office',
|
|
136
|
-
133: 'Funicular',
|
|
137
|
-
134: 'Ultralight Area',
|
|
138
|
-
135: 'Bar',
|
|
139
|
-
136: 'Stadium',
|
|
140
|
-
137: 'Reef',
|
|
141
|
-
138: 'Scenic Area',
|
|
142
|
-
139: 'Pizza',
|
|
143
|
-
140: 'Ball Park',
|
|
144
|
-
141: 'Stadium',
|
|
145
|
-
142: 'Building',
|
|
146
|
-
143: 'Contact, Pig',
|
|
147
|
-
144: 'Building',
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
147: 'Department Store',
|
|
151
|
-
148: 'School',
|
|
152
|
-
149: 'Scales',
|
|
153
|
-
150: 'Stadium',
|
|
154
|
-
|
|
155
|
-
152: 'Medical Facility',
|
|
156
|
-
153: 'Medical Facility',
|
|
157
|
-
154: 'City Hall',
|
|
158
|
-
155: 'Exit',
|
|
159
|
-
156: 'Fast Food',
|
|
160
|
-
157: 'Heliport',
|
|
161
|
-
158: 'Fast Food',
|
|
162
|
-
159: 'Shopping Center',
|
|
163
|
-
160: 'Summit',
|
|
164
|
-
161: 'Parking, Pay',
|
|
165
|
-
162: 'Pharmacy',
|
|
166
|
-
163: 'Telephone',
|
|
167
|
-
164: 'Stadium',
|
|
168
|
-
165: 'Church',
|
|
169
|
-
166: 'Railway',
|
|
170
|
-
167: 'Railway',
|
|
171
|
-
168: 'Stadium',
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
172: 'Restaurant',
|
|
176
|
-
173: 'Stadium',
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
176: 'Multi-Cache',
|
|
180
|
-
177: 'Stump',
|
|
181
|
-
178: 'Gas Station',
|
|
182
|
-
179: 'Gas Station',
|
|
183
|
-
180: 'Swimming Area'
|
|
111
|
+
108: 'ATV', // off-road
|
|
112
|
+
109: 'Dam', // dam
|
|
113
|
+
110: 'Skull and Crossbones', // danger
|
|
114
|
+
111: 'City Hall', // office
|
|
115
|
+
112: 'Geocache Found', // gift
|
|
116
|
+
113: 'Contact, Blonde', // hairdresser
|
|
117
|
+
114: 'Favorite', // heart
|
|
118
|
+
115: 'Oil Field', // industry
|
|
119
|
+
116: 'Contact, Smiley', // laundry
|
|
120
|
+
117: 'Radio Beacon', // lighthouse
|
|
121
|
+
//118: '', // UNUSED
|
|
122
|
+
119: 'Fitness Center', // playground
|
|
123
|
+
120: 'Police Station', // police
|
|
124
|
+
121: 'Police Station', // prison
|
|
125
|
+
122: 'Restricted Area', // roadblock
|
|
126
|
+
123: 'Contact, Alien', // rocket
|
|
127
|
+
124: 'School', // school
|
|
128
|
+
125: 'Lodge', // shelter
|
|
129
|
+
126: 'Rectangle, Blue', // suitcase
|
|
130
|
+
127: 'Dog Sitting', // veterinary
|
|
131
|
+
128: 'Sad Face', // remove
|
|
132
|
+
129: 'Levee', // wetland
|
|
133
|
+
130: 'Circle, Green', // wheelchair
|
|
134
|
+
131: 'Golf Course', // golf
|
|
135
|
+
132: 'Post Office', // envelope
|
|
136
|
+
133: 'Funicular', // aerialway
|
|
137
|
+
134: 'Ultralight Area', // airfield
|
|
138
|
+
135: 'Bar', // alcohol_shop
|
|
139
|
+
136: 'Stadium', // american_football
|
|
140
|
+
137: 'Reef', // aquarium
|
|
141
|
+
138: 'Scenic Area', // attraction
|
|
142
|
+
139: 'Pizza', // bakery
|
|
143
|
+
140: 'Ball Park', // baseball
|
|
144
|
+
141: 'Stadium', // basketball
|
|
145
|
+
142: 'Building', // building
|
|
146
|
+
143: 'Contact, Pig', // butcher
|
|
147
|
+
144: 'Building', // castle
|
|
148
|
+
//145: '', // UNUSED
|
|
149
|
+
//146: '', // UNUSED
|
|
150
|
+
147: 'Department Store', // clothing_store
|
|
151
|
+
148: 'School', // college
|
|
152
|
+
149: 'Scales', // commercial
|
|
153
|
+
150: 'Stadium', // cricket
|
|
154
|
+
//151: '', // UNUSED
|
|
155
|
+
152: 'Medical Facility', // dentist
|
|
156
|
+
153: 'Medical Facility', // doctor
|
|
157
|
+
154: 'City Hall', // embassy
|
|
158
|
+
155: 'Exit', // entrance
|
|
159
|
+
156: 'Fast Food', // fast_food
|
|
160
|
+
157: 'Heliport', // heliport
|
|
161
|
+
158: 'Fast Food', // ice_cream
|
|
162
|
+
159: 'Shopping Center', // food_shop
|
|
163
|
+
160: 'Summit', // mountain
|
|
164
|
+
161: 'Parking, Pay', // parking_garage
|
|
165
|
+
162: 'Pharmacy', // pharmacy
|
|
166
|
+
163: 'Telephone', // phone
|
|
167
|
+
164: 'Stadium', // pitch
|
|
168
|
+
165: 'Church', // place_of_worship
|
|
169
|
+
166: 'Railway', // rail_light
|
|
170
|
+
167: 'Railway', // rail_metro
|
|
171
|
+
168: 'Stadium', // soccer
|
|
172
|
+
//169: '', // UNUSED
|
|
173
|
+
//170: '', // UNUSED
|
|
174
|
+
//171: '', // UNUSED
|
|
175
|
+
172: 'Restaurant', // sushi
|
|
176
|
+
173: 'Stadium', // tennis
|
|
177
|
+
//174: '', // UNUSED
|
|
178
|
+
//175: '', // UNUSED
|
|
179
|
+
176: 'Multi-Cache', // warehouse
|
|
180
|
+
177: 'Stump', // garden
|
|
181
|
+
178: 'Gas Station', // diesel
|
|
182
|
+
179: 'Gas Station', // ethanol-free
|
|
183
|
+
180: 'Swimming Area' // swimming
|
|
184
184
|
},
|
|
185
185
|
toFurkot: {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
'Bike Trail': 8,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
'City Hall': 41,
|
|
192
|
-
'Fast Food': 156,
|
|
193
|
-
|
|
194
|
-
'Flag, Blue': 1,
|
|
195
|
-
'Gas Station': 25,
|
|
186
|
+
ATV: 91, // atv
|
|
187
|
+
Bar: 31, // bar
|
|
188
|
+
'Bike Trail': 8, // biking
|
|
189
|
+
Building: 51, // structure
|
|
190
|
+
Church: 34, // church
|
|
191
|
+
'City Hall': 41, // town_hall
|
|
192
|
+
'Fast Food': 156, // fast_food
|
|
193
|
+
Favorite: 114, // heart
|
|
194
|
+
'Flag, Blue': 1, // stop (default)
|
|
195
|
+
'Gas Station': 25, // fillingstation
|
|
196
196
|
'Ground Transportation': 106, // bus
|
|
197
|
-
'Medical Facility': 81,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
'Police Station': 120,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
'Scenic Area': 61,
|
|
207
|
-
|
|
208
|
-
'Shopping Center': 99,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
'Swimming Area': 54,
|
|
212
|
-
'Trail Head': 2
|
|
197
|
+
'Medical Facility': 81, // hospital
|
|
198
|
+
Library: 66, // library
|
|
199
|
+
Lodging: 0, // hotel
|
|
200
|
+
Museum: 33, // museum
|
|
201
|
+
Park: 50, // park
|
|
202
|
+
'Police Station': 120, // police
|
|
203
|
+
Railway: 97, // train
|
|
204
|
+
Residence: 12, // house
|
|
205
|
+
Restaurant: 24, // restaurant
|
|
206
|
+
'Scenic Area': 61, // lookout
|
|
207
|
+
School: 124, // school
|
|
208
|
+
'Shopping Center': 99, // cart
|
|
209
|
+
Stadium: 68, // stadium
|
|
210
|
+
Summit: 59, // mountains
|
|
211
|
+
'Swimming Area': 54, // watersport
|
|
212
|
+
'Trail Head': 2 // guide
|
|
213
213
|
},
|
|
214
214
|
colors: {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
215
|
+
2: 'Black',
|
|
216
|
+
3: 'Blue',
|
|
217
|
+
4: 'Cyan',
|
|
218
|
+
5: 'DarkBlue',
|
|
219
|
+
6: 'DarkCyan',
|
|
220
|
+
7: 'DarkGray',
|
|
221
|
+
8: 'DarkGreen',
|
|
222
|
+
9: 'DarkMagenta',
|
|
223
223
|
10: 'DarkRed',
|
|
224
224
|
11: 'DarkYellow',
|
|
225
225
|
12: 'Green',
|
package/lib/index.js
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} = require('./garmin');
|
|
6
|
-
const sprite = require('./sprite');
|
|
1
|
+
import garmin from './garmin.js';
|
|
2
|
+
import sprite from './sprite.json' with { type: 'json' };
|
|
3
|
+
|
|
4
|
+
const { toGarmin, toFurkot, colors } = garmin;
|
|
7
5
|
|
|
8
6
|
const schema = [
|
|
9
7
|
[
|
|
10
|
-
'xmlns:gpxx',
|
|
8
|
+
'xmlns:gpxx',
|
|
9
|
+
'http://www.garmin.com/xmlschemas/GpxExtensions/v3',
|
|
11
10
|
'http://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd'
|
|
12
11
|
],
|
|
13
12
|
[
|
|
14
|
-
'xmlns:trp',
|
|
13
|
+
'xmlns:trp',
|
|
14
|
+
'http://www.garmin.com/xmlschemas/TripExtensions/v1',
|
|
15
15
|
'http://www.garmin.com/xmlschemas/TripExtensionsv1.xsd'
|
|
16
16
|
],
|
|
17
17
|
[
|
|
18
|
-
'xmlns:tmd',
|
|
18
|
+
'xmlns:tmd',
|
|
19
|
+
'http://www.garmin.com/xmlschemas/TripMetaDataExtensions/v1',
|
|
19
20
|
'http://www.garmin.com/xmlschemas/TripMetaDataExtensionsv1.xsd'
|
|
20
21
|
],
|
|
21
22
|
[
|
|
22
|
-
'xmlns:vptm',
|
|
23
|
+
'xmlns:vptm',
|
|
24
|
+
'http://www.garmin.com/xmlschemas/ViaPointTransportationModeExtensions/v1',
|
|
23
25
|
'http://www.garmin.com/xmlschemas/ViaPointTransportationModeExtensionsv1.xsd'
|
|
24
26
|
]
|
|
25
27
|
];
|
|
26
28
|
|
|
27
|
-
const modeMap = [
|
|
28
|
-
'Motorcycling',
|
|
29
|
-
'Automotive',
|
|
30
|
-
'Bicycling',
|
|
31
|
-
'Walking',
|
|
32
|
-
'Direct',
|
|
33
|
-
'Direct',
|
|
34
|
-
'RV',
|
|
35
|
-
'Direct'
|
|
36
|
-
];
|
|
29
|
+
const modeMap = ['Motorcycling', 'Automotive', 'Bicycling', 'Walking', 'Direct', 'Direct', 'RV', 'Direct'];
|
|
37
30
|
|
|
38
31
|
function getMode(rMode, mMode) {
|
|
39
32
|
if (rMode !== undefined) {
|
|
@@ -119,7 +112,6 @@ function getRteExt({ ctx, start, end, el, elIfText }) {
|
|
|
119
112
|
}
|
|
120
113
|
|
|
121
114
|
function getRtePtExt({ ctx, precision, start, end, each, el, elIfText }) {
|
|
122
|
-
|
|
123
115
|
function* $gpxxRpt(p, subclass) {
|
|
124
116
|
const attribs = {
|
|
125
117
|
lat: p[1].toFixed(precision),
|
|
@@ -135,7 +127,7 @@ function getRtePtExt({ ctx, precision, start, end, each, el, elIfText }) {
|
|
|
135
127
|
}
|
|
136
128
|
}
|
|
137
129
|
|
|
138
|
-
return function* (
|
|
130
|
+
return function* (_rt, st, index, next) {
|
|
139
131
|
let shapingPoint;
|
|
140
132
|
|
|
141
133
|
if (st.stopIsActualStop || index % 124 === 0 || !next) {
|
|
@@ -161,7 +153,6 @@ function getRtePtExt({ ctx, precision, start, end, each, el, elIfText }) {
|
|
|
161
153
|
yield* el('trp:ShapingPoint');
|
|
162
154
|
}
|
|
163
155
|
if (next && next.mode !== undefined) {
|
|
164
|
-
|
|
165
156
|
//- The <vptm:ViaPointTransportationMode> extension tells the devices Trip Planner algorithm
|
|
166
157
|
//- what calculation type to use between this and next point:
|
|
167
158
|
//- Automotive, Motorcycling, Walking, Bicycling, Direct.
|
|
@@ -176,7 +167,7 @@ function getRtePtExt({ ctx, precision, start, end, each, el, elIfText }) {
|
|
|
176
167
|
//- the Trip Planner algorithm. This specific code says to use the above RoutePoint as a waypoint.
|
|
177
168
|
//- Older Garmin devices don't use the Trip Planner algorithm.
|
|
178
169
|
yield* el('gpxx:Subclass', null, '000000000000FFFFFFFFFFFFFFFFFFFFFFFF');
|
|
179
|
-
const expanded = next
|
|
170
|
+
const expanded = next?.track;
|
|
180
171
|
|
|
181
172
|
if (expanded) {
|
|
182
173
|
yield* each(expanded, function* (p) {
|
|
@@ -214,11 +205,14 @@ function getTrkExt({ start, end, elIfText }) {
|
|
|
214
205
|
};
|
|
215
206
|
}
|
|
216
207
|
|
|
217
|
-
|
|
208
|
+
export default {
|
|
218
209
|
getWptCmt: st => st.notes,
|
|
219
210
|
getWptSym: st => toGarmin[st.sym],
|
|
220
|
-
hasWptExt: st =>
|
|
221
|
-
st.
|
|
211
|
+
hasWptExt: st =>
|
|
212
|
+
st.stopStreetAddress ||
|
|
213
|
+
st.locality?.town ||
|
|
214
|
+
st.locality?.province ||
|
|
215
|
+
st.locality?.country_long ||
|
|
222
216
|
st.phone ||
|
|
223
217
|
st.tags?.length,
|
|
224
218
|
getWptExt,
|
package/package.json
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furkot/garmin-data",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Data used by Furkot modules dealing with Garmin GPX format.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Damian Krzeminski",
|
|
7
7
|
"email": "pirxpilot@code42day.com",
|
|
8
8
|
"url": "https://code42day.com"
|
|
9
9
|
},
|
|
10
|
-
"repository":
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/furkot/garmin-data.git"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": "./lib/index.js",
|
|
11
16
|
"license": "MIT",
|
|
12
17
|
"keywords": [
|
|
13
18
|
"furkot-garmin-data",
|
|
14
19
|
"furkot",
|
|
15
20
|
"garmin"
|
|
16
21
|
],
|
|
17
|
-
"dependencies": {
|
|
18
|
-
|
|
19
|
-
"jshint": "~2",
|
|
20
|
-
"mocha": "~10",
|
|
21
|
-
"should": "~13"
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@biomejs/biome": "^2.3.11"
|
|
22
24
|
},
|
|
23
25
|
"scripts": {
|
|
24
26
|
"test": "make check"
|
|
25
27
|
},
|
|
26
28
|
"files": [
|
|
27
|
-
"index.js",
|
|
28
29
|
"lib",
|
|
29
30
|
"sprite"
|
|
30
31
|
]
|
|
31
|
-
}
|
|
32
|
+
}
|