586 Commits

Author SHA1 Message Date
vcoppe
e5ad8bbb70 New translations file.mdx (French) 2025-11-10 20:34:51 +01:00
vcoppe
7f6acbfdbc Update source file file.mdx 2025-11-10 20:33:50 +01:00
vcoppe
2e070529e0 New translations routing.mdx (Portuguese, Brazilian) 2025-11-10 19:08:15 +01:00
vcoppe
f4b31e5f0a New translations routing.mdx (Chinese Simplified) 2025-11-10 19:08:14 +01:00
vcoppe
f7f093a464 New translations routing.mdx (Italian) 2025-11-10 19:08:09 +01:00
vcoppe
95cc340de5 New translations routing.mdx (Basque) 2025-11-10 19:08:06 +01:00
vcoppe
51a003c816 New translations routing.mdx (German) 2025-11-10 19:08:04 +01:00
vcoppe
977152139f New translations routing.mdx (Catalan) 2025-11-10 19:08:03 +01:00
vcoppe
78833df95e New translations file.mdx (Serbian (Latin)) 2025-11-10 19:06:14 +01:00
vcoppe
099d941d2e New translations file.mdx (Chinese Traditional, Hong Kong) 2025-11-10 19:06:13 +01:00
vcoppe
ea58f378a9 New translations file.mdx (Latvian) 2025-11-10 19:06:11 +01:00
vcoppe
4060884909 New translations file.mdx (Thai) 2025-11-10 19:06:10 +01:00
vcoppe
d9277c11d2 New translations file.mdx (Indonesian) 2025-11-10 19:06:09 +01:00
vcoppe
bcbc90820a New translations file.mdx (Portuguese, Brazilian) 2025-11-10 19:06:07 +01:00
vcoppe
e9caa95673 New translations file.mdx (Vietnamese) 2025-11-10 19:06:06 +01:00
vcoppe
9cd6703b05 New translations file.mdx (Chinese Simplified) 2025-11-10 19:06:05 +01:00
vcoppe
4233bd7771 New translations file.mdx (Ukrainian) 2025-11-10 19:06:03 +01:00
vcoppe
0e2db441f2 New translations file.mdx (Turkish) 2025-11-10 19:06:02 +01:00
vcoppe
571b101ea4 New translations file.mdx (Swedish) 2025-11-10 19:06:01 +01:00
vcoppe
0b9dca61ab New translations file.mdx (Russian) 2025-11-10 19:06:00 +01:00
vcoppe
d8fa76d076 New translations file.mdx (Portuguese) 2025-11-10 19:05:58 +01:00
vcoppe
6116eef513 New translations file.mdx (Polish) 2025-11-10 19:05:57 +01:00
vcoppe
fabe987f2c New translations file.mdx (Norwegian) 2025-11-10 19:05:56 +01:00
vcoppe
af20880f37 New translations file.mdx (Dutch) 2025-11-10 19:05:55 +01:00
vcoppe
44eeab0d4b New translations file.mdx (Lithuanian) 2025-11-10 19:05:53 +01:00
vcoppe
b331900158 New translations file.mdx (Korean) 2025-11-10 19:05:52 +01:00
vcoppe
d74380404c New translations file.mdx (Italian) 2025-11-10 19:05:51 +01:00
vcoppe
3833a9cd6b New translations file.mdx (Hungarian) 2025-11-10 19:05:50 +01:00
vcoppe
74fdd943c9 New translations file.mdx (Hebrew) 2025-11-10 19:05:49 +01:00
vcoppe
ad5b772502 New translations file.mdx (Finnish) 2025-11-10 19:05:47 +01:00
vcoppe
9bc941aa31 New translations file.mdx (Basque) 2025-11-10 19:05:46 +01:00
vcoppe
705df43047 New translations file.mdx (Greek) 2025-11-10 19:05:45 +01:00
vcoppe
b31e3bb710 New translations file.mdx (German) 2025-11-10 19:05:44 +01:00
vcoppe
4082d0a368 New translations file.mdx (Danish) 2025-11-10 19:05:42 +01:00
vcoppe
ce85286cdf New translations file.mdx (Czech) 2025-11-10 19:05:41 +01:00
vcoppe
415cf1a777 New translations file.mdx (Catalan) 2025-11-10 19:05:40 +01:00
vcoppe
f249919ec8 New translations file.mdx (Belarusian) 2025-11-10 19:05:39 +01:00
vcoppe
054c9787d3 New translations file.mdx (Spanish) 2025-11-10 19:05:37 +01:00
vcoppe
c1e88e2b5a New translations file.mdx (French) 2025-11-10 19:05:36 +01:00
vcoppe
f5efeb16c4 New translations file.mdx (Romanian) 2025-11-10 19:05:35 +01:00
vcoppe
59afae7bca New translations translation.mdx (Portuguese, Brazilian) 2025-11-10 19:04:37 +01:00
vcoppe
92c6339064 New translations translation.mdx (Chinese Simplified) 2025-11-10 19:04:35 +01:00
vcoppe
582ae233f2 New translations translation.mdx (Turkish) 2025-11-10 19:04:34 +01:00
vcoppe
3c3016a211 New translations translation.mdx (Dutch) 2025-11-10 19:04:31 +01:00
vcoppe
e24e1d9d3c New translations translation.mdx (Italian) 2025-11-10 19:04:28 +01:00
vcoppe
85fb564be7 New translations translation.mdx (Basque) 2025-11-10 19:04:26 +01:00
vcoppe
18f7db9eee New translations translation.mdx (German) 2025-11-10 19:04:24 +01:00
vcoppe
ea0770fd11 New translations translation.mdx (Czech) 2025-11-10 19:04:23 +01:00
vcoppe
9c28fab3f9 New translations translation.mdx (Catalan) 2025-11-10 19:04:22 +01:00
vcoppe
bac332a8c4 New translations translation.mdx (Spanish) 2025-11-10 19:04:20 +01:00
vcoppe
86d2542bd9 New translations funding.mdx (Portuguese, Brazilian) 2025-11-10 19:04:02 +01:00
vcoppe
5f63ec884f New translations funding.mdx (Chinese Simplified) 2025-11-10 19:04:00 +01:00
vcoppe
0f87b33354 New translations funding.mdx (Turkish) 2025-11-10 19:03:58 +01:00
vcoppe
c7dc99a12f New translations funding.mdx (Dutch) 2025-11-10 19:03:55 +01:00
vcoppe
05c3c3f8f3 New translations funding.mdx (Italian) 2025-11-10 19:03:53 +01:00
vcoppe
2437a43471 New translations funding.mdx (Basque) 2025-11-10 19:03:50 +01:00
vcoppe
16cd812ba0 New translations funding.mdx (German) 2025-11-10 19:03:49 +01:00
vcoppe
c036128720 New translations funding.mdx (Czech) 2025-11-10 19:03:47 +01:00
vcoppe
645db15848 New translations funding.mdx (Catalan) 2025-11-10 19:03:45 +01:00
vcoppe
21e142ffc3 New translations funding.mdx (Spanish) 2025-11-10 19:03:44 +01:00
vcoppe
23a6b3db72 New translations funding.mdx (French) 2025-11-10 19:03:43 +01:00
vcoppe
b87d109625 New translations routing.mdx (Czech) 2025-11-10 19:03:04 +01:00
vcoppe
651bd295b9 New translations en.json (French) 2025-11-10 19:02:37 +01:00
vcoppe
01607e92b9 Update source file routing.mdx 2025-11-10 19:02:30 +01:00
vcoppe
f40d54adbb Update source file poi.mdx 2025-11-10 19:02:29 +01:00
vcoppe
60fb387495 Update source file minify.mdx 2025-11-10 19:02:28 +01:00
vcoppe
a7df18723c Update source file toolbar.mdx 2025-11-10 19:02:26 +01:00
vcoppe
4e39cc937a Update source file translation.mdx 2025-11-10 19:02:24 +01:00
vcoppe
fe513c17ab Update source file funding.mdx 2025-11-10 19:02:23 +01:00
vcoppe
f7fb88ed3d Update source file files-and-stats.mdx 2025-11-10 19:02:22 +01:00
vcoppe
b3247c7cbe Update source file en.json 2025-11-10 19:02:21 +01:00
vcoppe
97e79c23f6 New translations routing.mdx (Serbian (Latin)) 2025-11-10 18:51:41 +01:00
vcoppe
7803a29875 New translations routing.mdx (Chinese Traditional, Hong Kong) 2025-11-10 18:51:40 +01:00
vcoppe
08093beed1 New translations routing.mdx (Latvian) 2025-11-10 18:51:38 +01:00
vcoppe
ae46ae89bc New translations routing.mdx (Thai) 2025-11-10 18:51:37 +01:00
vcoppe
f7977dca39 New translations routing.mdx (Indonesian) 2025-11-10 18:51:36 +01:00
vcoppe
0b344f3e08 New translations routing.mdx (Portuguese, Brazilian) 2025-11-10 18:51:35 +01:00
vcoppe
6058154eca New translations routing.mdx (Vietnamese) 2025-11-10 18:51:34 +01:00
vcoppe
941016f04b New translations routing.mdx (Chinese Simplified) 2025-11-10 18:51:33 +01:00
vcoppe
7a15898087 New translations routing.mdx (Ukrainian) 2025-11-10 18:51:31 +01:00
vcoppe
6b4effa90f New translations routing.mdx (Turkish) 2025-11-10 18:51:30 +01:00
vcoppe
77d56e4a4c New translations routing.mdx (Swedish) 2025-11-10 18:51:29 +01:00
vcoppe
c4dd622e7b New translations routing.mdx (Russian) 2025-11-10 18:51:28 +01:00
vcoppe
9f24535142 New translations routing.mdx (Portuguese) 2025-11-10 18:51:26 +01:00
vcoppe
a45161fcb8 New translations routing.mdx (Polish) 2025-11-10 18:51:25 +01:00
vcoppe
4379763a73 New translations routing.mdx (Norwegian) 2025-11-10 18:51:23 +01:00
vcoppe
a25b376dfd New translations routing.mdx (Dutch) 2025-11-10 18:51:21 +01:00
vcoppe
fb429f6777 New translations routing.mdx (Lithuanian) 2025-11-10 18:51:20 +01:00
vcoppe
ae33227c3a New translations routing.mdx (Korean) 2025-11-10 18:51:19 +01:00
vcoppe
2fedc61d1e New translations routing.mdx (Italian) 2025-11-10 18:51:18 +01:00
vcoppe
6988a36dd1 New translations routing.mdx (Hungarian) 2025-11-10 18:51:17 +01:00
vcoppe
60e1124970 New translations routing.mdx (Hebrew) 2025-11-10 18:51:15 +01:00
vcoppe
a007684006 New translations routing.mdx (Finnish) 2025-11-10 18:51:13 +01:00
vcoppe
090a709522 New translations routing.mdx (Basque) 2025-11-10 18:51:12 +01:00
vcoppe
9e06655214 New translations routing.mdx (Greek) 2025-11-10 18:51:11 +01:00
vcoppe
3651825e79 New translations routing.mdx (German) 2025-11-10 18:51:09 +01:00
vcoppe
dcf3160b58 New translations routing.mdx (Danish) 2025-11-10 18:51:08 +01:00
vcoppe
fd014f42cd New translations routing.mdx (Catalan) 2025-11-10 18:51:07 +01:00
vcoppe
a760f2f7fc New translations routing.mdx (Belarusian) 2025-11-10 18:51:06 +01:00
vcoppe
262c114b7d New translations routing.mdx (Spanish) 2025-11-10 18:51:05 +01:00
vcoppe
c90bdd83bb New translations routing.mdx (French) 2025-11-10 18:51:03 +01:00
vcoppe
fdb2d37b12 New translations routing.mdx (Romanian) 2025-11-10 18:51:02 +01:00
vcoppe
7951837ecf New translations poi.mdx (Serbian (Latin)) 2025-11-10 18:51:00 +01:00
vcoppe
d2e112a672 New translations poi.mdx (Chinese Traditional, Hong Kong) 2025-11-10 18:50:59 +01:00
vcoppe
90e86077ba New translations poi.mdx (Latvian) 2025-11-10 18:50:58 +01:00
vcoppe
f69dfcdefe New translations poi.mdx (Thai) 2025-11-10 18:50:57 +01:00
vcoppe
5cff7c4e72 New translations poi.mdx (Indonesian) 2025-11-10 18:50:56 +01:00
vcoppe
0eaa833cdf New translations poi.mdx (Portuguese, Brazilian) 2025-11-10 18:50:55 +01:00
vcoppe
db015d925e New translations poi.mdx (Vietnamese) 2025-11-10 18:50:54 +01:00
vcoppe
69fd47601e New translations poi.mdx (Chinese Simplified) 2025-11-10 18:50:52 +01:00
vcoppe
17521574f0 New translations poi.mdx (Ukrainian) 2025-11-10 18:50:51 +01:00
vcoppe
56650a76ae New translations poi.mdx (Turkish) 2025-11-10 18:50:49 +01:00
vcoppe
984a98e792 New translations poi.mdx (Swedish) 2025-11-10 18:50:48 +01:00
vcoppe
49eb0cf202 New translations poi.mdx (Russian) 2025-11-10 18:50:47 +01:00
vcoppe
8e24a6b036 New translations poi.mdx (Portuguese) 2025-11-10 18:50:46 +01:00
vcoppe
d07bf6d699 New translations poi.mdx (Polish) 2025-11-10 18:50:45 +01:00
vcoppe
877d12c676 New translations poi.mdx (Norwegian) 2025-11-10 18:50:44 +01:00
vcoppe
ca629f625a New translations poi.mdx (Dutch) 2025-11-10 18:50:43 +01:00
vcoppe
087dd9a4b6 New translations poi.mdx (Lithuanian) 2025-11-10 18:50:41 +01:00
vcoppe
d9a967c072 New translations poi.mdx (Korean) 2025-11-10 18:50:40 +01:00
vcoppe
6d522c82c3 New translations poi.mdx (Italian) 2025-11-10 18:50:39 +01:00
vcoppe
867af98083 New translations poi.mdx (Hungarian) 2025-11-10 18:50:38 +01:00
vcoppe
1be058d831 New translations poi.mdx (Hebrew) 2025-11-10 18:50:37 +01:00
vcoppe
71bc044ae5 New translations poi.mdx (Finnish) 2025-11-10 18:50:36 +01:00
vcoppe
d660c50ade New translations poi.mdx (Basque) 2025-11-10 18:50:35 +01:00
vcoppe
3fd733d903 New translations poi.mdx (Greek) 2025-11-10 18:50:33 +01:00
vcoppe
7703b2361d New translations poi.mdx (German) 2025-11-10 18:50:32 +01:00
vcoppe
68fdb9ebc6 New translations poi.mdx (Danish) 2025-11-10 18:50:31 +01:00
vcoppe
b6513343be New translations poi.mdx (Czech) 2025-11-10 18:50:30 +01:00
vcoppe
cc95ff1c55 New translations poi.mdx (Catalan) 2025-11-10 18:50:29 +01:00
vcoppe
c954ee0fde New translations poi.mdx (Belarusian) 2025-11-10 18:50:28 +01:00
vcoppe
1ada5e5d18 New translations poi.mdx (Spanish) 2025-11-10 18:50:27 +01:00
vcoppe
f5244c3d93 New translations poi.mdx (French) 2025-11-10 18:50:26 +01:00
vcoppe
1f17776cd4 New translations poi.mdx (Romanian) 2025-11-10 18:50:24 +01:00
vcoppe
ebd4f36f94 New translations minify.mdx (Serbian (Latin)) 2025-11-10 18:50:23 +01:00
vcoppe
dbb9b5f254 New translations minify.mdx (Chinese Traditional, Hong Kong) 2025-11-10 18:50:22 +01:00
vcoppe
4301472cb2 New translations minify.mdx (Latvian) 2025-11-10 18:50:20 +01:00
vcoppe
15e7954321 New translations minify.mdx (Thai) 2025-11-10 18:50:19 +01:00
vcoppe
32d1de08e9 New translations minify.mdx (Indonesian) 2025-11-10 18:50:18 +01:00
vcoppe
ea88663dce New translations minify.mdx (Portuguese, Brazilian) 2025-11-10 18:50:16 +01:00
vcoppe
97aecaf890 New translations minify.mdx (Vietnamese) 2025-11-10 18:50:15 +01:00
vcoppe
b16688e1b7 New translations minify.mdx (Chinese Simplified) 2025-11-10 18:50:13 +01:00
vcoppe
5ac856251b New translations minify.mdx (Ukrainian) 2025-11-10 18:50:12 +01:00
vcoppe
62a9aacd85 New translations minify.mdx (Turkish) 2025-11-10 18:50:10 +01:00
vcoppe
dff0b55a8c New translations minify.mdx (Swedish) 2025-11-10 18:50:09 +01:00
vcoppe
3b21c75b13 New translations minify.mdx (Russian) 2025-11-10 18:50:08 +01:00
vcoppe
2c7cc4b8e5 New translations minify.mdx (Portuguese) 2025-11-10 18:50:07 +01:00
vcoppe
bcf8c0e35c New translations minify.mdx (Polish) 2025-11-10 18:50:05 +01:00
vcoppe
11d2936fca New translations minify.mdx (Norwegian) 2025-11-10 18:50:04 +01:00
vcoppe
5e84429e24 New translations minify.mdx (Dutch) 2025-11-10 18:50:02 +01:00
vcoppe
48c88b2d7e New translations minify.mdx (Lithuanian) 2025-11-10 18:50:00 +01:00
vcoppe
e5185c0b77 New translations minify.mdx (Korean) 2025-11-10 18:49:59 +01:00
vcoppe
15773d3aba New translations minify.mdx (Italian) 2025-11-10 18:49:58 +01:00
vcoppe
b577837446 New translations minify.mdx (Hungarian) 2025-11-10 18:49:56 +01:00
vcoppe
324e234b2a New translations minify.mdx (Hebrew) 2025-11-10 18:49:55 +01:00
vcoppe
d40fefb0ea New translations minify.mdx (Finnish) 2025-11-10 18:49:54 +01:00
vcoppe
7e05568549 New translations minify.mdx (Basque) 2025-11-10 18:49:52 +01:00
vcoppe
0249a52d1c New translations minify.mdx (Greek) 2025-11-10 18:49:50 +01:00
vcoppe
5df1c5b09b New translations minify.mdx (German) 2025-11-10 18:49:49 +01:00
vcoppe
953ec8fe31 New translations minify.mdx (Danish) 2025-11-10 18:49:48 +01:00
vcoppe
6054afebdc New translations minify.mdx (Czech) 2025-11-10 18:49:46 +01:00
vcoppe
04f356e119 New translations minify.mdx (Catalan) 2025-11-10 18:49:45 +01:00
vcoppe
a6ebefbb30 New translations minify.mdx (Belarusian) 2025-11-10 18:49:44 +01:00
vcoppe
9a1edbe1fa New translations minify.mdx (Spanish) 2025-11-10 18:49:43 +01:00
vcoppe
c46d74be54 New translations minify.mdx (French) 2025-11-10 18:49:42 +01:00
vcoppe
72e949586a New translations minify.mdx (Romanian) 2025-11-10 18:49:41 +01:00
vcoppe
68dacad741 New translations toolbar.mdx (Serbian (Latin)) 2025-11-10 18:48:33 +01:00
vcoppe
7e6505ca73 New translations toolbar.mdx (Chinese Traditional, Hong Kong) 2025-11-10 18:48:32 +01:00
vcoppe
362d83f504 New translations toolbar.mdx (Latvian) 2025-11-10 18:48:31 +01:00
vcoppe
e4879736b7 New translations toolbar.mdx (Thai) 2025-11-10 18:48:29 +01:00
vcoppe
68fe6628c7 New translations toolbar.mdx (Indonesian) 2025-11-10 18:48:28 +01:00
vcoppe
f39ef569be New translations toolbar.mdx (Portuguese, Brazilian) 2025-11-10 18:48:27 +01:00
vcoppe
42c199376a New translations toolbar.mdx (Vietnamese) 2025-11-10 18:48:26 +01:00
vcoppe
cd6b774a8c New translations toolbar.mdx (Chinese Simplified) 2025-11-10 18:48:25 +01:00
vcoppe
62598f94f8 New translations toolbar.mdx (Ukrainian) 2025-11-10 18:48:24 +01:00
vcoppe
aa3b46141f New translations toolbar.mdx (Turkish) 2025-11-10 18:48:21 +01:00
vcoppe
dcaa2aaeab New translations toolbar.mdx (Swedish) 2025-11-10 18:48:20 +01:00
vcoppe
e36f5e47da New translations toolbar.mdx (Russian) 2025-11-10 18:48:19 +01:00
vcoppe
578d7b41b4 New translations toolbar.mdx (Portuguese) 2025-11-10 18:48:18 +01:00
vcoppe
c4f81ce279 New translations toolbar.mdx (Polish) 2025-11-10 18:48:16 +01:00
vcoppe
02a7dbea85 New translations toolbar.mdx (Norwegian) 2025-11-10 18:48:15 +01:00
vcoppe
0305d3fe36 New translations toolbar.mdx (Dutch) 2025-11-10 18:48:13 +01:00
vcoppe
84fd034197 New translations toolbar.mdx (Lithuanian) 2025-11-10 18:48:11 +01:00
vcoppe
61b48e2048 New translations toolbar.mdx (Korean) 2025-11-10 18:48:10 +01:00
vcoppe
c91f85389c New translations toolbar.mdx (Italian) 2025-11-10 18:48:09 +01:00
vcoppe
f3683355a9 New translations toolbar.mdx (Hungarian) 2025-11-10 18:48:08 +01:00
vcoppe
a86da886f4 New translations toolbar.mdx (Hebrew) 2025-11-10 18:48:06 +01:00
vcoppe
7bf8d42eb8 New translations toolbar.mdx (Finnish) 2025-11-10 18:48:05 +01:00
vcoppe
88533e29b9 New translations toolbar.mdx (Basque) 2025-11-10 18:48:03 +01:00
vcoppe
8299dcc881 New translations toolbar.mdx (Greek) 2025-11-10 18:48:01 +01:00
vcoppe
0d0c250fea New translations toolbar.mdx (German) 2025-11-10 18:48:00 +01:00
vcoppe
eb8d86616b New translations toolbar.mdx (Danish) 2025-11-10 18:47:59 +01:00
vcoppe
1edc90810f New translations toolbar.mdx (Czech) 2025-11-10 18:47:58 +01:00
vcoppe
c011d84a35 New translations toolbar.mdx (Catalan) 2025-11-10 18:47:56 +01:00
vcoppe
b97f62ac12 New translations toolbar.mdx (Belarusian) 2025-11-10 18:47:55 +01:00
vcoppe
200a38bdc0 New translations toolbar.mdx (Spanish) 2025-11-10 18:47:54 +01:00
vcoppe
e12c53a90e New translations toolbar.mdx (French) 2025-11-10 18:47:53 +01:00
vcoppe
7892916f56 New translations toolbar.mdx (Romanian) 2025-11-10 18:47:51 +01:00
vcoppe
5d681beab3 New translations translation.mdx (Serbian (Latin)) 2025-11-10 18:45:10 +01:00
vcoppe
a54a2affb3 New translations translation.mdx (Chinese Traditional, Hong Kong) 2025-11-10 18:45:09 +01:00
vcoppe
120062bb85 New translations translation.mdx (Latvian) 2025-11-10 18:45:07 +01:00
vcoppe
a0754d2bd7 New translations translation.mdx (Thai) 2025-11-10 18:45:06 +01:00
vcoppe
f4b13a84d4 New translations translation.mdx (Indonesian) 2025-11-10 18:45:05 +01:00
vcoppe
1c98e27e4d New translations translation.mdx (Portuguese, Brazilian) 2025-11-10 18:45:04 +01:00
vcoppe
6067e25df8 New translations translation.mdx (Vietnamese) 2025-11-10 18:45:02 +01:00
vcoppe
304c50a247 New translations translation.mdx (Chinese Simplified) 2025-11-10 18:45:00 +01:00
vcoppe
274ad8eac2 New translations translation.mdx (Ukrainian) 2025-11-10 18:44:59 +01:00
vcoppe
9946a3fc0e New translations translation.mdx (Turkish) 2025-11-10 18:44:58 +01:00
vcoppe
622d6db968 New translations translation.mdx (Swedish) 2025-11-10 18:44:56 +01:00
vcoppe
d756ce0656 New translations translation.mdx (Russian) 2025-11-10 18:44:55 +01:00
vcoppe
316e776355 New translations translation.mdx (Portuguese) 2025-11-10 18:44:54 +01:00
vcoppe
f861b7ad99 New translations translation.mdx (Polish) 2025-11-10 18:44:53 +01:00
vcoppe
01382e98f3 New translations translation.mdx (Norwegian) 2025-11-10 18:44:52 +01:00
vcoppe
3371442bbc New translations translation.mdx (Dutch) 2025-11-10 18:44:51 +01:00
vcoppe
a81a804364 New translations translation.mdx (Lithuanian) 2025-11-10 18:44:50 +01:00
vcoppe
b24cf5c946 New translations translation.mdx (Korean) 2025-11-10 18:44:48 +01:00
vcoppe
3d60213644 New translations translation.mdx (Italian) 2025-11-10 18:44:47 +01:00
vcoppe
a23822c9df New translations translation.mdx (Hungarian) 2025-11-10 18:44:46 +01:00
vcoppe
9fa69758f1 New translations translation.mdx (Hebrew) 2025-11-10 18:44:45 +01:00
vcoppe
c892d3f134 New translations translation.mdx (Finnish) 2025-11-10 18:44:44 +01:00
vcoppe
73271501dc New translations translation.mdx (Basque) 2025-11-10 18:44:43 +01:00
vcoppe
a62ea520e7 New translations translation.mdx (Greek) 2025-11-10 18:44:42 +01:00
vcoppe
a2a0b3c71e New translations translation.mdx (German) 2025-11-10 18:44:40 +01:00
vcoppe
51bedbe003 New translations translation.mdx (Danish) 2025-11-10 18:44:39 +01:00
vcoppe
7062a3e657 New translations translation.mdx (Czech) 2025-11-10 18:44:38 +01:00
vcoppe
209d95d5da New translations translation.mdx (Catalan) 2025-11-10 18:44:37 +01:00
vcoppe
95ee74ab2b New translations translation.mdx (Belarusian) 2025-11-10 18:44:36 +01:00
vcoppe
9f6b268dce New translations translation.mdx (Spanish) 2025-11-10 18:44:35 +01:00
vcoppe
96e8ebcc10 New translations translation.mdx (French) 2025-11-10 18:44:33 +01:00
vcoppe
ca261c7037 New translations translation.mdx (Romanian) 2025-11-10 18:44:32 +01:00
vcoppe
a95fe13b31 New translations funding.mdx (Serbian (Latin)) 2025-11-10 18:44:09 +01:00
vcoppe
c3fe76adf9 New translations funding.mdx (Chinese Traditional, Hong Kong) 2025-11-10 18:44:07 +01:00
vcoppe
e9b9d51a6e New translations funding.mdx (Latvian) 2025-11-10 18:44:06 +01:00
vcoppe
aff66205e9 New translations funding.mdx (Thai) 2025-11-10 18:44:05 +01:00
vcoppe
aa0c9d65ae New translations funding.mdx (Indonesian) 2025-11-10 18:44:04 +01:00
vcoppe
423bd2122f New translations funding.mdx (Portuguese, Brazilian) 2025-11-10 18:44:02 +01:00
vcoppe
7533910114 New translations funding.mdx (Vietnamese) 2025-11-10 18:44:01 +01:00
vcoppe
0d4d377c22 New translations funding.mdx (Chinese Simplified) 2025-11-10 18:43:59 +01:00
vcoppe
3a576b3ea5 New translations funding.mdx (Ukrainian) 2025-11-10 18:43:58 +01:00
vcoppe
27f37744a0 New translations funding.mdx (Turkish) 2025-11-10 18:43:57 +01:00
vcoppe
012ecad0bb New translations funding.mdx (Swedish) 2025-11-10 18:43:55 +01:00
vcoppe
49b5d5e961 New translations funding.mdx (Russian) 2025-11-10 18:43:54 +01:00
vcoppe
01ca48fe96 New translations funding.mdx (Portuguese) 2025-11-10 18:43:52 +01:00
vcoppe
5abe5045b2 New translations funding.mdx (Polish) 2025-11-10 18:43:51 +01:00
vcoppe
8c79a577b9 New translations funding.mdx (Norwegian) 2025-11-10 18:43:50 +01:00
vcoppe
5b18f1016f New translations funding.mdx (Dutch) 2025-11-10 18:43:49 +01:00
vcoppe
bda58312bb New translations funding.mdx (Lithuanian) 2025-11-10 18:43:47 +01:00
vcoppe
eff352a003 New translations funding.mdx (Korean) 2025-11-10 18:43:46 +01:00
vcoppe
3109d4ff82 New translations funding.mdx (Italian) 2025-11-10 18:43:45 +01:00
vcoppe
c44eda3af6 New translations funding.mdx (Hungarian) 2025-11-10 18:43:44 +01:00
vcoppe
33e8c41c6f New translations funding.mdx (Hebrew) 2025-11-10 18:43:43 +01:00
vcoppe
e0b515ba2b New translations funding.mdx (Finnish) 2025-11-10 18:43:42 +01:00
vcoppe
c6b6ad41fb New translations funding.mdx (Basque) 2025-11-10 18:43:40 +01:00
vcoppe
99576238cd New translations funding.mdx (Greek) 2025-11-10 18:43:39 +01:00
vcoppe
db712650ef New translations funding.mdx (German) 2025-11-10 18:43:38 +01:00
vcoppe
d77e7b07eb New translations funding.mdx (Danish) 2025-11-10 18:43:37 +01:00
vcoppe
47b35fad3f New translations funding.mdx (Czech) 2025-11-10 18:43:36 +01:00
vcoppe
720105ca92 New translations funding.mdx (Catalan) 2025-11-10 18:43:35 +01:00
vcoppe
ce656068e3 New translations funding.mdx (Belarusian) 2025-11-10 18:43:34 +01:00
vcoppe
e69ba76e7d New translations funding.mdx (Spanish) 2025-11-10 18:43:32 +01:00
vcoppe
d1bab213a3 New translations funding.mdx (French) 2025-11-10 18:43:31 +01:00
vcoppe
016a9341ad New translations funding.mdx (Romanian) 2025-11-10 18:43:30 +01:00
vcoppe
81f407ad5f New translations files-and-stats.mdx (Serbian (Latin)) 2025-11-10 18:42:44 +01:00
vcoppe
37ff2f6bdb New translations files-and-stats.mdx (Chinese Traditional, Hong Kong) 2025-11-10 18:42:43 +01:00
vcoppe
13cf1a9551 New translations files-and-stats.mdx (Latvian) 2025-11-10 18:42:41 +01:00
vcoppe
799aaac449 New translations files-and-stats.mdx (Thai) 2025-11-10 18:42:40 +01:00
vcoppe
fbe430e4cf New translations files-and-stats.mdx (Indonesian) 2025-11-10 18:42:39 +01:00
vcoppe
511746620e New translations files-and-stats.mdx (Portuguese, Brazilian) 2025-11-10 18:42:38 +01:00
vcoppe
fed5b648f8 New translations files-and-stats.mdx (Vietnamese) 2025-11-10 18:42:37 +01:00
vcoppe
1f601743f6 New translations files-and-stats.mdx (Chinese Simplified) 2025-11-10 18:42:36 +01:00
vcoppe
db3ccf5da7 New translations files-and-stats.mdx (Ukrainian) 2025-11-10 18:42:34 +01:00
vcoppe
038898d580 New translations files-and-stats.mdx (Turkish) 2025-11-10 18:42:33 +01:00
vcoppe
dafbc6bc51 New translations files-and-stats.mdx (Swedish) 2025-11-10 18:42:32 +01:00
vcoppe
3d8271e7a1 New translations files-and-stats.mdx (Russian) 2025-11-10 18:42:31 +01:00
vcoppe
e2ade95219 New translations files-and-stats.mdx (Portuguese) 2025-11-10 18:42:30 +01:00
vcoppe
604971a576 New translations files-and-stats.mdx (Polish) 2025-11-10 18:42:28 +01:00
vcoppe
76173103af New translations files-and-stats.mdx (Norwegian) 2025-11-10 18:42:27 +01:00
vcoppe
3fcbc60232 New translations routing.mdx (Czech) 2025-11-10 18:42:26 +01:00
vcoppe
835bdb39d0 New translations files-and-stats.mdx (Dutch) 2025-11-10 18:42:25 +01:00
vcoppe
200f09c5d2 New translations files-and-stats.mdx (Lithuanian) 2025-11-10 18:42:23 +01:00
vcoppe
99a008f122 New translations files-and-stats.mdx (Korean) 2025-11-10 18:42:22 +01:00
vcoppe
9b71e89ba0 New translations files-and-stats.mdx (Italian) 2025-11-10 18:42:20 +01:00
vcoppe
9955369cfa New translations files-and-stats.mdx (Hungarian) 2025-11-10 18:42:18 +01:00
vcoppe
6ef6ffab66 New translations files-and-stats.mdx (Hebrew) 2025-11-10 18:42:17 +01:00
vcoppe
0dd46f0f20 New translations files-and-stats.mdx (Finnish) 2025-11-10 18:42:15 +01:00
vcoppe
cce0d85dd4 New translations files-and-stats.mdx (Basque) 2025-11-10 18:42:14 +01:00
vcoppe
1ed3eae038 New translations files-and-stats.mdx (Greek) 2025-11-10 18:42:12 +01:00
vcoppe
2854c24197 New translations files-and-stats.mdx (German) 2025-11-10 18:42:10 +01:00
vcoppe
4b90ddda2a New translations files-and-stats.mdx (Danish) 2025-11-10 18:42:09 +01:00
vcoppe
552c39e583 New translations files-and-stats.mdx (Czech) 2025-11-10 18:42:08 +01:00
vcoppe
5176e459b5 New translations files-and-stats.mdx (Catalan) 2025-11-10 18:42:06 +01:00
vcoppe
39515d0600 New translations files-and-stats.mdx (Belarusian) 2025-11-10 18:42:05 +01:00
vcoppe
5314949394 New translations files-and-stats.mdx (Spanish) 2025-11-10 18:42:02 +01:00
vcoppe
59e5be749c New translations files-and-stats.mdx (French) 2025-11-10 18:42:01 +01:00
vcoppe
da252a0070 New translations files-and-stats.mdx (Romanian) 2025-11-10 18:42:00 +01:00
vcoppe
b6199e430c New translations en.json (Serbian (Latin)) 2025-11-10 18:41:58 +01:00
vcoppe
e260a68c26 New translations en.json (Chinese Traditional, Hong Kong) 2025-11-10 18:41:57 +01:00
vcoppe
570cb2deaf New translations en.json (Latvian) 2025-11-10 18:41:55 +01:00
vcoppe
7a36f03fb5 New translations en.json (Thai) 2025-11-10 18:41:54 +01:00
vcoppe
6c3058ba97 New translations en.json (Indonesian) 2025-11-10 18:41:53 +01:00
vcoppe
48a1034c12 New translations en.json (Portuguese, Brazilian) 2025-11-10 18:41:52 +01:00
vcoppe
aaddb50ab9 New translations en.json (Vietnamese) 2025-11-10 18:41:51 +01:00
vcoppe
a947586cfe New translations en.json (Chinese Simplified) 2025-11-10 18:41:49 +01:00
vcoppe
f3cfa14a59 New translations en.json (Ukrainian) 2025-11-10 18:41:48 +01:00
vcoppe
a2c0a77c53 New translations en.json (Turkish) 2025-11-10 18:41:47 +01:00
vcoppe
c078f9d5cb New translations en.json (Swedish) 2025-11-10 18:41:46 +01:00
vcoppe
08eab8a157 New translations en.json (Russian) 2025-11-10 18:41:45 +01:00
vcoppe
9c36f234bc New translations en.json (Portuguese) 2025-11-10 18:41:44 +01:00
vcoppe
36b81d0e2a New translations en.json (Polish) 2025-11-10 18:41:42 +01:00
vcoppe
4432c14377 New translations en.json (Norwegian) 2025-11-10 18:41:41 +01:00
vcoppe
99e6dd5ca3 New translations en.json (Dutch) 2025-11-10 18:41:40 +01:00
vcoppe
6327a25aec New translations en.json (Lithuanian) 2025-11-10 18:41:39 +01:00
vcoppe
40989de7f5 New translations en.json (Korean) 2025-11-10 18:41:38 +01:00
vcoppe
58af44e795 New translations en.json (Italian) 2025-11-10 18:41:36 +01:00
vcoppe
4910cc05f8 New translations en.json (Hungarian) 2025-11-10 18:41:35 +01:00
vcoppe
164ee24d16 New translations en.json (Hebrew) 2025-11-10 18:41:34 +01:00
vcoppe
0ffda4ab7c New translations en.json (Finnish) 2025-11-10 18:41:33 +01:00
vcoppe
4694a6271d New translations en.json (Basque) 2025-11-10 18:41:32 +01:00
vcoppe
2f50bc747a New translations en.json (Greek) 2025-11-10 18:41:30 +01:00
vcoppe
a13f621a81 New translations en.json (German) 2025-11-10 18:41:29 +01:00
vcoppe
0cc520cc67 New translations en.json (Czech) 2025-11-10 18:41:28 +01:00
vcoppe
c9451c3f2d New translations en.json (Catalan) 2025-11-10 18:41:26 +01:00
vcoppe
8da53ffda2 New translations en.json (Belarusian) 2025-11-10 18:41:25 +01:00
vcoppe
4319761687 New translations en.json (Spanish) 2025-11-10 18:41:24 +01:00
vcoppe
a1f3227cd9 New translations en.json (Romanian) 2025-11-10 18:41:22 +01:00
vcoppe
b07f87c920 New translations en.json (Danish) 2025-11-10 18:41:21 +01:00
vcoppe
9c8f23eb64 New translations en.json (French) 2025-11-10 18:41:19 +01:00
vcoppe
2d232b3c4b New translations routing.mdx (Czech) 2025-11-09 23:00:54 +01:00
vcoppe
712dc9bb34 New translations en.json (Danish) 2025-11-04 06:53:16 +01:00
vcoppe
5c338d53ae New translations en.json (Danish) 2025-11-04 05:49:17 +01:00
vcoppe
8d26842aab New translations en.json (Russian) 2025-10-21 12:25:32 +02:00
vcoppe
76e654304b New translations en.json (Russian) 2025-10-21 10:35:36 +02:00
vcoppe
32ba679719 New translations en.json (Korean) 2025-10-17 09:13:10 +02:00
vcoppe
cac0fefcdb New translations en.json (Chinese Traditional, Hong Kong) 2025-10-14 02:30:52 +02:00
vcoppe
498c76dd96 New translations en.json (Chinese Simplified) 2025-10-14 02:30:51 +02:00
vcoppe
7526182304 New translations en.json (Romanian) 2025-10-12 09:39:34 +02:00
vcoppe
d46bbd9cbf New translations en.json (Romanian) 2025-10-12 08:41:16 +02:00
vcoppe
e98b537499 New translations en.json (Ukrainian) 2025-10-09 12:12:30 +02:00
vcoppe
fc9d8509e5 New translations en.json (Ukrainian) 2025-10-09 10:21:48 +02:00
vcoppe
7c6bbb61b5 New translations en.json (Ukrainian) 2025-10-08 21:12:54 +02:00
vcoppe
8501ddc87f New translations faq.mdx (Polish) 2025-10-07 19:48:49 +02:00
vcoppe
7d9b94525e New translations time.mdx (Polish) 2025-10-07 19:48:48 +02:00
vcoppe
eb02f0eadf New translations scissors.mdx (Polish) 2025-10-07 19:48:47 +02:00
vcoppe
69a8ba5aec New translations routing.mdx (Polish) 2025-10-07 19:48:46 +02:00
vcoppe
fe49b8e618 New translations merge.mdx (Polish) 2025-10-07 19:48:45 +02:00
vcoppe
26bf4dde5f New translations extract.mdx (Polish) 2025-10-07 19:48:44 +02:00
vcoppe
e9b73050ba New translations toolbar.mdx (Polish) 2025-10-07 19:48:43 +02:00
vcoppe
bacd0ab43f New translations view.mdx (Polish) 2025-10-07 19:48:42 +02:00
vcoppe
e438051371 New translations file.mdx (Polish) 2025-10-07 19:48:40 +02:00
vcoppe
314155593d New translations edit.mdx (Polish) 2025-10-07 19:48:39 +02:00
vcoppe
787f819ce0 New translations menu.mdx (Polish) 2025-10-07 19:48:38 +02:00
vcoppe
3632a62ea3 New translations integration.mdx (Polish) 2025-10-07 19:48:37 +02:00
vcoppe
c7294df007 New translations gpx.mdx (Polish) 2025-10-07 19:48:36 +02:00
vcoppe
e3ad7fe3c0 New translations getting-started.mdx (Polish) 2025-10-07 19:48:34 +02:00
vcoppe
6213683ddf New translations files-and-stats.mdx (Polish) 2025-10-07 19:48:33 +02:00
vcoppe
a4ddfc9970 New translations en.json (Polish) 2025-10-07 19:48:32 +02:00
vcoppe
7ff271f9b9 New translations view.mdx (Spanish) 2025-10-07 02:54:04 +02:00
vcoppe
d75cdd63a9 New translations file.mdx (Spanish) 2025-10-07 02:54:02 +02:00
vcoppe
0a7575d1e4 New translations integration.mdx (Spanish) 2025-10-07 02:54:01 +02:00
vcoppe
ec3022d8ad New translations en.json (Spanish) 2025-10-07 01:50:49 +02:00
vcoppe
d42103b91b New translations en.json (Ukrainian) 2025-10-03 23:57:07 +02:00
vcoppe
00f7d08b04 New translations en.json (Ukrainian) 2025-10-03 22:36:21 +02:00
vcoppe
408cc383cb New translations en.json (Portuguese) 2025-10-03 17:56:00 +02:00
vcoppe
5c926d0ac6 New translations en.json (Ukrainian) 2025-09-23 18:44:01 +02:00
vcoppe
5cb88782fc New translations en.json (Ukrainian) 2025-09-23 15:59:34 +02:00
vcoppe
5eef4e9ece New translations en.json (Russian) 2025-09-20 17:13:17 +02:00
vcoppe
04a2124141 New translations en.json (Italian) 2025-09-20 17:13:15 +02:00
vcoppe
1b6229b2a1 New translations elevation.mdx (Italian) 2025-09-20 16:10:28 +02:00
vcoppe
bca6db50a7 New translations en.json (Italian) 2025-09-20 16:10:27 +02:00
vcoppe
f3aae26996 New translations settings.mdx (Chinese Simplified) 2025-09-10 10:34:12 +02:00
vcoppe
f3c17a8e0f New translations en.json (Indonesian) 2025-09-05 04:13:37 +02:00
vcoppe
d6b24f8753 New translations en.json (Indonesian) 2025-09-05 03:11:41 +02:00
vcoppe
253db0a303 New translations en.json (Norwegian) 2025-09-04 18:13:32 +02:00
vcoppe
8499e52461 New translations en.json (Dutch) 2025-09-01 08:57:32 +02:00
vcoppe
d0153179a9 New translations en.json (Indonesian) 2025-08-29 18:50:34 +02:00
vcoppe
264d03727e New translations edit.mdx (Chinese Traditional, Hong Kong) 2025-08-13 18:27:34 +02:00
vcoppe
544405d9b9 New translations en.json (Chinese Traditional, Hong Kong) 2025-08-13 16:32:09 +02:00
vcoppe
24488a3b67 New translations en.json (Indonesian) 2025-08-08 14:15:35 +02:00
vcoppe
ae78185b29 New translations en.json (Indonesian) 2025-08-08 12:50:22 +02:00
vcoppe
7f682b24ef New translations en.json (Indonesian) 2025-08-04 04:32:52 +02:00
vcoppe
d42a52d8cf New translations en.json (Norwegian) 2025-08-03 16:13:45 +02:00
vcoppe
b85df15890 New translations en.json (Norwegian) 2025-08-03 15:00:56 +02:00
vcoppe
393499f34f New translations en.json (Indonesian) 2025-08-02 13:58:57 +02:00
vcoppe
c656d0f9b5 New translations en.json (Indonesian) 2025-08-02 12:40:02 +02:00
vcoppe
32017a8859 New translations en.json (Indonesian) 2025-08-02 11:35:56 +02:00
vcoppe
d87c5b1140 New translations en.json (Norwegian) 2025-08-01 22:28:15 +02:00
vcoppe
f59f783d3f New translations en.json (Norwegian) 2025-08-01 21:18:36 +02:00
vcoppe
ec298eac61 New translations elevation.mdx (Indonesian) 2025-08-01 16:14:37 +02:00
vcoppe
81a25bb4ee New translations faq.mdx (Indonesian) 2025-08-01 16:14:36 +02:00
vcoppe
e99f044e45 New translations time.mdx (Indonesian) 2025-08-01 16:14:35 +02:00
vcoppe
5ae25a5fd9 New translations scissors.mdx (Indonesian) 2025-08-01 16:14:34 +02:00
vcoppe
e9d1cb4907 New translations routing.mdx (Indonesian) 2025-08-01 16:14:33 +02:00
vcoppe
99f8ca2dca New translations poi.mdx (Indonesian) 2025-08-01 16:14:31 +02:00
vcoppe
ddea5d38b5 New translations minify.mdx (Indonesian) 2025-08-01 16:14:30 +02:00
vcoppe
31d2b83550 New translations merge.mdx (Indonesian) 2025-08-01 16:14:29 +02:00
vcoppe
5535e56ed2 New translations extract.mdx (Indonesian) 2025-08-01 16:14:28 +02:00
vcoppe
d740b95dbc New translations clean.mdx (Indonesian) 2025-08-01 16:14:26 +02:00
vcoppe
ae92e9a945 New translations toolbar.mdx (Indonesian) 2025-08-01 16:14:25 +02:00
vcoppe
29730c3896 New translations view.mdx (Indonesian) 2025-08-01 16:14:24 +02:00
vcoppe
a5ae8270f0 New translations settings.mdx (Indonesian) 2025-08-01 16:14:23 +02:00
vcoppe
54f5fa6432 New translations file.mdx (Indonesian) 2025-08-01 16:14:22 +02:00
vcoppe
0260644063 New translations edit.mdx (Indonesian) 2025-08-01 16:14:20 +02:00
vcoppe
267fc03a82 New translations menu.mdx (Indonesian) 2025-08-01 16:14:19 +02:00
vcoppe
bf1537584c New translations map-controls.mdx (Indonesian) 2025-08-01 16:14:18 +02:00
vcoppe
9ee7825022 New translations integration.mdx (Indonesian) 2025-08-01 16:14:17 +02:00
vcoppe
2be0c42dd1 New translations translation.mdx (Indonesian) 2025-08-01 16:14:16 +02:00
vcoppe
3423c053a2 New translations mapbox.mdx (Indonesian) 2025-08-01 16:14:15 +02:00
vcoppe
26923cca00 New translations funding.mdx (Indonesian) 2025-08-01 16:14:14 +02:00
vcoppe
36e027659c New translations gpx.mdx (Indonesian) 2025-08-01 16:14:13 +02:00
vcoppe
f447dccdb4 New translations getting-started.mdx (Indonesian) 2025-08-01 16:14:11 +02:00
vcoppe
69eae32851 New translations files-and-stats.mdx (Indonesian) 2025-08-01 16:14:10 +02:00
vcoppe
aa2fcfb8cb New translations en.json (Indonesian) 2025-08-01 16:14:09 +02:00
vcoppe
fae5ef2a41 New translations en.json (Norwegian) 2025-07-31 23:43:31 +02:00
vcoppe
7251ca7d2d New translations toolbar.mdx (Norwegian) 2025-07-31 22:34:29 +02:00
vcoppe
7cdbd919bf New translations en.json (Norwegian) 2025-07-31 22:34:27 +02:00
vcoppe
d450f95602 New translations en.json (Dutch) 2025-07-31 14:26:59 +02:00
vcoppe
5a65201971 New translations en.json (Thai) 2025-07-30 18:35:07 +02:00
vcoppe
d303b8db3e New translations gpx.mdx (Portuguese) 2025-07-20 19:33:06 +02:00
vcoppe
06baa33827 New translations gpx.mdx (Portuguese) 2025-07-20 18:31:13 +02:00
vcoppe
42743e637e New translations en.json (French) 2025-07-18 16:38:10 +02:00
vcoppe
9969fd7dec New translations edit.mdx (Swedish) 2025-07-17 23:06:28 +02:00
vcoppe
fc6d5c2a1d New translations en.json (Basque) 2025-07-16 07:51:58 +02:00
vcoppe
f8abb1ca24 New translations elevation.mdx (Thai) 2025-07-15 14:10:56 +02:00
vcoppe
a5af38ae3d New translations faq.mdx (Thai) 2025-07-15 14:10:55 +02:00
vcoppe
aab70951dc New translations time.mdx (Thai) 2025-07-15 14:10:54 +02:00
vcoppe
334cacf93c New translations scissors.mdx (Thai) 2025-07-15 14:10:52 +02:00
vcoppe
53024012fc New translations routing.mdx (Thai) 2025-07-15 14:10:51 +02:00
vcoppe
86a72f77c1 New translations poi.mdx (Thai) 2025-07-15 14:10:50 +02:00
vcoppe
bc11a5ad0a New translations minify.mdx (Thai) 2025-07-15 14:10:49 +02:00
vcoppe
8f2d217fd4 New translations merge.mdx (Thai) 2025-07-15 14:10:47 +02:00
vcoppe
183727cd50 New translations extract.mdx (Thai) 2025-07-15 14:10:46 +02:00
vcoppe
676e87591a New translations clean.mdx (Thai) 2025-07-15 14:10:44 +02:00
vcoppe
8c05fc4da0 New translations toolbar.mdx (Thai) 2025-07-15 14:10:43 +02:00
vcoppe
2bab06561e New translations view.mdx (Thai) 2025-07-15 14:10:42 +02:00
vcoppe
dfa7e2f5bb New translations settings.mdx (Thai) 2025-07-15 14:10:41 +02:00
vcoppe
78bece5616 New translations file.mdx (Thai) 2025-07-15 14:10:39 +02:00
vcoppe
eeea15e373 New translations edit.mdx (Thai) 2025-07-15 14:10:38 +02:00
vcoppe
80cd513ab7 New translations menu.mdx (Thai) 2025-07-15 14:10:37 +02:00
vcoppe
942ef1615e New translations map-controls.mdx (Thai) 2025-07-15 14:10:35 +02:00
vcoppe
a354698022 New translations integration.mdx (Thai) 2025-07-15 14:10:34 +02:00
vcoppe
0cdea488c9 New translations translation.mdx (Thai) 2025-07-15 14:10:33 +02:00
vcoppe
4f4291ac47 New translations mapbox.mdx (Thai) 2025-07-15 14:10:32 +02:00
vcoppe
bf0cf03091 New translations funding.mdx (Thai) 2025-07-15 14:10:30 +02:00
vcoppe
f7da09f20f New translations gpx.mdx (Thai) 2025-07-15 14:10:28 +02:00
vcoppe
be1529331c New translations getting-started.mdx (Thai) 2025-07-15 14:10:27 +02:00
vcoppe
301d658a29 New translations files-and-stats.mdx (Thai) 2025-07-15 14:10:26 +02:00
vcoppe
1cc54e5b2c New translations en.json (Thai) 2025-07-15 14:10:25 +02:00
vcoppe
65a7fd21e7 New translations en.json (Italian) 2025-07-14 12:56:13 +02:00
vcoppe
856537c0cd New translations en.json (Ukrainian) 2025-07-10 01:33:15 +02:00
vcoppe
b2a88e0063 New translations en.json (Ukrainian) 2025-07-10 00:32:33 +02:00
vcoppe
85a7068785 New translations en.json (Ukrainian) 2025-07-09 12:14:44 +02:00
vcoppe
cbb733d99a New translations settings.mdx (Ukrainian) 2025-07-07 18:53:29 +02:00
vcoppe
ce88c94a19 New translations edit.mdx (Ukrainian) 2025-07-07 18:53:28 +02:00
vcoppe
16516915d8 New translations translation.mdx (Ukrainian) 2025-07-07 18:53:27 +02:00
vcoppe
6addb8da23 New translations mapbox.mdx (Ukrainian) 2025-07-07 18:53:26 +02:00
vcoppe
bc7f664fd8 New translations funding.mdx (Ukrainian) 2025-07-07 17:28:09 +02:00
vcoppe
aac17aa33c New translations en.json (Ukrainian) 2025-07-07 17:28:08 +02:00
vcoppe
825500e207 New translations en.json (Ukrainian) 2025-07-07 15:46:23 +02:00
vcoppe
4d42016c72 New translations en.json (Italian) 2025-06-28 14:49:34 +02:00
vcoppe
9d665df602 New translations poi.mdx (Polish) 2025-06-23 23:44:31 +02:00
vcoppe
9087f69fb0 New translations minify.mdx (Polish) 2025-06-23 23:44:30 +02:00
vcoppe
2a06f6a214 New translations clean.mdx (Polish) 2025-06-23 23:44:29 +02:00
vcoppe
78a8428bd0 New translations toolbar.mdx (Polish) 2025-06-23 23:44:28 +02:00
vcoppe
0d235768fa New translations menu.mdx (Polish) 2025-06-23 23:44:26 +02:00
vcoppe
af092bbdec New translations edit.mdx (Polish) 2025-06-23 22:23:55 +02:00
vcoppe
4961630d62 New translations en.json (Chinese Traditional, Hong Kong) 2025-06-20 05:53:38 +02:00
vcoppe
81920b9ab9 New translations en.json (Chinese Traditional, Hong Kong) 2025-06-20 04:39:50 +02:00
vcoppe
9e031d3b5b New translations en.json (Chinese Traditional, Hong Kong) 2025-06-20 03:33:14 +02:00
vcoppe
7ae3ed6d2a New translations elevation.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:44 +02:00
vcoppe
05d79f2b51 New translations faq.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:43 +02:00
vcoppe
274e591354 New translations time.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:42 +02:00
vcoppe
95fd152b3d New translations scissors.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:41 +02:00
vcoppe
ffc91ed6d8 New translations routing.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:40 +02:00
vcoppe
de0b759875 New translations poi.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:38 +02:00
vcoppe
f041dcf944 New translations minify.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:37 +02:00
vcoppe
946b9bd9d1 New translations merge.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:36 +02:00
vcoppe
db77a69838 New translations extract.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:35 +02:00
vcoppe
d10f4d26e2 New translations clean.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:34 +02:00
vcoppe
6b62d686ba New translations toolbar.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:33 +02:00
vcoppe
065826e64d New translations view.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:32 +02:00
vcoppe
a3b096343f New translations settings.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:31 +02:00
vcoppe
b33be91b06 New translations file.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:29 +02:00
vcoppe
a94a1816c5 New translations edit.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:28 +02:00
vcoppe
9a9e7fea07 New translations menu.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:27 +02:00
vcoppe
9a03042077 New translations map-controls.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:26 +02:00
vcoppe
704d3b2d6b New translations integration.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:24 +02:00
vcoppe
e5c2be238d New translations translation.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:23 +02:00
vcoppe
9feea07527 New translations mapbox.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:22 +02:00
vcoppe
b0967d03b8 New translations funding.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:21 +02:00
vcoppe
d33fd71f93 New translations gpx.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:20 +02:00
vcoppe
226b5b2682 New translations getting-started.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:18 +02:00
vcoppe
f8879b0223 New translations files-and-stats.mdx (Chinese Traditional, Hong Kong) 2025-06-19 18:26:17 +02:00
vcoppe
ada09d96c4 New translations en.json (Chinese Traditional, Hong Kong) 2025-06-19 18:26:16 +02:00
vcoppe
a9ea0e223d add turkish language 2025-06-07 11:30:06 +02:00
vcoppe
37e8237f78 New Crowdin updates (#225)
* New translations settings.mdx (Turkish)

* New translations edit.mdx (Turkish)

* New translations file.mdx (Turkish)

* New translations view.mdx (Turkish)

* New translations files-and-stats.mdx (Turkish)

* New translations gpx.mdx (Turkish)

* New translations map-controls.mdx (Turkish)

* New translations routing.mdx (Turkish)

* New translations files-and-stats.mdx (French)

* New translations files-and-stats.mdx (Spanish)

* New translations files-and-stats.mdx (Catalan)

* New translations files-and-stats.mdx (Czech)

* New translations files-and-stats.mdx (German)

* New translations files-and-stats.mdx (Basque)

* New translations files-and-stats.mdx (Italian)

* New translations files-and-stats.mdx (Dutch)

* New translations files-and-stats.mdx (Chinese Simplified)
2025-06-07 11:29:19 +02:00
vcoppe
40deb19837 New Crowdin updates (#224)
* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations funding.mdx (Turkish)

* New translations mapbox.mdx (Turkish)

* New translations translation.mdx (Turkish)

* New translations settings.mdx (Turkish)

* New translations settings.mdx (Turkish)

* New translations edit.mdx (Turkish)

* New translations file.mdx (Turkish)

* New translations view.mdx (Turkish)

* New translations routing.mdx (Turkish)

* New translations view.mdx (Turkish)

* New translations routing.mdx (Turkish)

* New translations clean.mdx (Turkish)

* New translations extract.mdx (Turkish)

* New translations merge.mdx (Turkish)

* New translations minify.mdx (Turkish)

* New translations poi.mdx (Turkish)

* New translations scissors.mdx (Turkish)

* New translations elevation.mdx (Turkish)

* New translations scissors.mdx (Turkish)

* New translations files-and-stats.mdx (Turkish)

* New translations getting-started.mdx (Turkish)

* New translations menu.mdx (Turkish)

* New translations toolbar.mdx (Turkish)

* New translations time.mdx (Turkish)

* New translations faq.mdx (Turkish)

* New translations edit.mdx (Turkish)

* New translations view.mdx (Turkish)

* New translations files-and-stats.mdx (Turkish)

* New translations getting-started.mdx (Turkish)

* New translations menu.mdx (Turkish)

* New translations toolbar.mdx (Turkish)

* New translations gpx.mdx (Turkish)

* New translations integration.mdx (Turkish)

* New translations map-controls.mdx (Turkish)

* New translations view.mdx (Turkish)

* New translations integration.mdx (Turkish)

* New translations map-controls.mdx (Turkish)
2025-06-07 10:36:02 +02:00
vcoppe
a9deb681e0 add Overpass POI website as wpt link 2025-06-04 18:55:14 +02:00
vcoppe
018e638ae3 New Crowdin updates (#220)
* New translations en.json (Chinese Simplified)

* New translations poi.mdx (Basque)

* New translations en.json (Swedish)

* New translations en.json (Polish)

* New translations en.json (Swedish)

* New translations files-and-stats.mdx (Swedish)

* New translations integration.mdx (Swedish)

* New translations getting-started.mdx (Swedish)

* New translations gpx.mdx (Swedish)

* New translations files-and-stats.mdx (Swedish)

* New translations gpx.mdx (Swedish)

* New translations routing.mdx (Swedish)

* New translations elevation.mdx (Swedish)

* New translations minify.mdx (Swedish)

* New translations routing.mdx (Swedish)

* New translations scissors.mdx (Swedish)

* New translations faq.mdx (Swedish)

* New translations edit.mdx (Swedish)

* New translations settings.mdx (Swedish)

* New translations view.mdx (Swedish)

* New translations map-controls.mdx (Swedish)

* New translations menu.mdx (Swedish)

* New translations edit.mdx (Swedish)

* New translations files-and-stats.mdx (Swedish)

* New translations getting-started.mdx (Swedish)

* New translations gpx.mdx (Swedish)

* New translations integration.mdx (Swedish)

* New translations map-controls.mdx (Swedish)

* New translations menu.mdx (Swedish)

* New translations edit.mdx (Swedish)

* New translations routing.mdx (Swedish)

* New translations scissors.mdx (Swedish)

* New translations time.mdx (Swedish)

* New translations extract.mdx (Swedish)

* New translations merge.mdx (Swedish)

* New translations minify.mdx (Swedish)

* New translations poi.mdx (Swedish)

* New translations routing.mdx (Swedish)

* New translations elevation.mdx (Swedish)

* New translations en.json (Swedish)

* New translations edit.mdx (Swedish)

* New translations file.mdx (Swedish)

* New translations view.mdx (Swedish)

* New translations toolbar.mdx (Swedish)

* New translations clean.mdx (Swedish)

* New translations files-and-stats.mdx (Swedish)

* New translations map-controls.mdx (Swedish)

* New translations minify.mdx (Swedish)

* New translations poi.mdx (Swedish)

* New translations routing.mdx (Swedish)

* New translations scissors.mdx (Swedish)

* New translations faq.mdx (Swedish)
2025-06-04 18:41:56 +02:00
vcoppe
967d271667 simplify shift key detection 2025-06-04 18:41:28 +02:00
vcoppe
4e92a16d8d fix zip creation when multiple files have the same name 2025-05-23 09:12:02 +02:00
vcoppe
b4bcda12c2 New Crowdin updates (#219)
* New translations en.json (Basque)

* New translations files-and-stats.mdx (Czech)

* New translations files-and-stats.mdx (Romanian)

* New translations files-and-stats.mdx (French)

* New translations files-and-stats.mdx (Spanish)

* New translations files-and-stats.mdx (Belarusian)

* New translations files-and-stats.mdx (Catalan)

* New translations files-and-stats.mdx (Danish)

* New translations files-and-stats.mdx (German)

* New translations files-and-stats.mdx (Greek)

* New translations files-and-stats.mdx (Basque)

* New translations files-and-stats.mdx (Finnish)

* New translations files-and-stats.mdx (Hebrew)

* New translations files-and-stats.mdx (Hungarian)

* New translations files-and-stats.mdx (Italian)

* New translations files-and-stats.mdx (Korean)

* New translations files-and-stats.mdx (Lithuanian)

* New translations files-and-stats.mdx (Dutch)

* New translations files-and-stats.mdx (Norwegian)

* New translations files-and-stats.mdx (Polish)

* New translations files-and-stats.mdx (Portuguese)

* New translations files-and-stats.mdx (Russian)

* New translations files-and-stats.mdx (Swedish)

* New translations files-and-stats.mdx (Turkish)

* New translations files-and-stats.mdx (Ukrainian)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Vietnamese)

* New translations files-and-stats.mdx (Portuguese, Brazilian)

* New translations files-and-stats.mdx (Latvian)

* New translations files-and-stats.mdx (Serbian (Latin))

* Update source file files-and-stats.mdx

* New translations files-and-stats.mdx (Czech)

* New translations files-and-stats.mdx (French)

* New translations files-and-stats.mdx (Spanish)

* New translations files-and-stats.mdx (Catalan)

* New translations files-and-stats.mdx (German)

* New translations files-and-stats.mdx (Basque)

* New translations files-and-stats.mdx (Italian)

* New translations files-and-stats.mdx (Dutch)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Portuguese, Brazilian)
2025-05-20 00:11:43 +02:00
Vianney Coppé
e5bb902cd4 Merge branch 'dev' of https://github.com/gpxstudio/gpx.studio into dev 2025-05-19 23:36:54 +02:00
Vianney Coppé
a3817fd5cd add elevation profile component to documentation, closes #217 2025-05-19 23:35:56 +02:00
vcoppe
3a6338e9fb add basque language 2025-05-14 21:54:01 +02:00
vcoppe
34d2342bdb New Crowdin updates (#218)
* New translations files-and-stats.mdx (Basque)

* New translations routing.mdx (Basque)

* New translations files-and-stats.mdx (Basque)

* New translations getting-started.mdx (Basque)

* New translations gpx.mdx (Basque)

* New translations integration.mdx (Basque)

* New translations map-controls.mdx (Basque)

* New translations file.mdx (Basque)

* New translations extract.mdx (Basque)

* New translations merge.mdx (Basque)

* New translations scissors.mdx (Basque)

* New translations faq.mdx (Basque)
2025-05-14 21:46:32 +02:00
vcoppe
5623a6b662 New Crowdin updates (#216)
* New translations en.json (Basque)

* New translations en.json (Basque)

* New translations en.json (Basque)

* New translations en.json (Basque)

* New translations funding.mdx (Basque)

* New translations mapbox.mdx (Basque)

* New translations translation.mdx (Basque)

* New translations settings.mdx (Basque)

* New translations translation.mdx (Basque)

* New translations edit.mdx (Basque)

* New translations settings.mdx (Basque)

* New translations en.json (Basque)

* New translations edit.mdx (Basque)

* New translations edit.mdx (Basque)

* New translations file.mdx (Basque)

* New translations funding.mdx (Polish)

* New translations file.mdx (Basque)

* New translations file.mdx (Basque)

* New translations settings.mdx (Basque)

* New translations routing.mdx (Basque)

* New translations settings.mdx (Basque)

* New translations view.mdx (Basque)

* New translations clean.mdx (Basque)

* New translations extract.mdx (Basque)

* New translations elevation.mdx (Basque)

* New translations elevation.mdx (Basque)

* New translations en.json (Portuguese, Brazilian)

* New translations routing.mdx (Basque)

* New translations merge.mdx (Basque)

* New translations merge.mdx (Basque)

* New translations minify.mdx (Basque)

* New translations poi.mdx (Basque)

* New translations routing.mdx (Basque)

* New translations scissors.mdx (Basque)

* New translations time.mdx (Basque)

* New translations faq.mdx (Basque)

* New translations files-and-stats.mdx (Basque)

* New translations getting-started.mdx (Basque)

* New translations gpx.mdx (Basque)

* New translations map-controls.mdx (Basque)

* New translations menu.mdx (Basque)

* New translations edit.mdx (Basque)

* New translations view.mdx (Basque)

* New translations toolbar.mdx (Basque)

* New translations faq.mdx (Basque)

* New translations gpx.mdx (Basque)

* New translations integration.mdx (Basque)

* New translations map-controls.mdx (Basque)

* New translations view.mdx (Basque)

* New translations en.json (Basque)

* New translations map-controls.mdx (Basque)

* New translations menu.mdx (Basque)

* New translations view.mdx (Basque)

* New translations toolbar.mdx (Basque)

* New translations poi.mdx (Basque)

* New translations routing.mdx (Basque)

* New translations elevation.mdx (Basque)

* New translations scissors.mdx (Basque)

* New translations getting-started.mdx (Basque)
2025-05-14 20:51:49 +02:00
vcoppe
de0cc63d53 move ts-node to devDependencies 2025-05-09 19:45:21 +02:00
vcoppe
cb4892ace3 rename file 2025-05-09 19:39:25 +02:00
vcoppe
3cd17d7409 New translations mapbox.mdx (Czech) (#215) 2025-05-08 19:49:19 +02:00
vcoppe
2848402e97 add apple touch icon 2025-05-08 19:48:13 +02:00
vcoppe
7e8f1acf67 remove apple touch icon 2025-05-08 18:54:46 +02:00
vcoppe
8aa8a77260 change import 2025-05-08 18:44:20 +02:00
vcoppe
ea4e078c92 New translations en.json (Dutch) (#213) 2025-05-08 18:39:23 +02:00
vcoppe
21261f732f improve icons 2025-05-08 18:39:12 +02:00
Jon Herman
4e9d65089c Add basic PWA support (#38) (#210)
* Add basic PWA support

See: https://github.com/gpxstudio/gpx.studio/issues/38

This will add a basic manifest.json file to the response that creates an
installable PWA.

It still needs to be internationalized.

* Refactor PWA integration and update dependencies

- Removed @vite-pwa/sveltekit dependency and related configurations from package.json and vite.config.ts.
- Added prebuild script to generate PWA manifest before build.
- Moved the manifest link to hooks.server.js and included Apple touch icon.
-Added images for various platforms. Images were generated with https://www.pwabuilder.com/imageGenerator

* use svg icon, fix urls, and remove generated manifest files

---------

Co-authored-by: jonherman <jonherman@gmail.com>
Co-authored-by: vcoppe <vianney.coppe@gmail.com>
2025-05-08 18:23:07 +02:00
vcoppe
e4f6dfbf78 fix logo 2025-05-08 15:16:47 +02:00
vcoppe
9083784ffd Merge branch 'dev' of https://github.com/gpxstudio/gpx.studio into dev 2025-05-08 14:55:35 +02:00
vcoppe
6c4c4dbac9 add czech 2025-05-08 14:54:48 +02:00
vcoppe
ea0abf15ce New translations view.mdx (Czech) (#212) 2025-05-08 14:54:14 +02:00
vcoppe
71cccc5bdc fix config, closes #211 2025-05-08 14:16:07 +02:00
vcoppe
4964928ac0 New Crowdin updates (#202)
* New translations en.json (German)

* New translations en.json (Italian)

* New translations settings.mdx (Italian)

* New translations en.json (Italian)

* New translations settings.mdx (Italian)

* New translations en.json (Portuguese)

* New translations en.json (Ukrainian)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations menu.mdx (Portuguese)

* New translations toolbar.mdx (Portuguese)

* New translations en.json (German)

* New translations translation.mdx (Portuguese)

* New translations en.json (Chinese Simplified)

* New translations toolbar.mdx (Polish)

* New translations menu.mdx (Portuguese)

* New translations getting-started.mdx (German)

* New translations edit.mdx (German)

* New translations view.mdx (German)

* New translations funding.mdx (Catalan)

* New translations edit.mdx (Czech)

* New translations file.mdx (Czech)

* New translations settings.mdx (Czech)

* New translations settings.mdx (Czech)

* New translations settings.mdx (Czech)

* New translations edit.mdx (Czech)

* New translations view.mdx (Czech)

* New translations extract.mdx (Czech)

* New translations merge.mdx (Czech)

* New translations scissors.mdx (Czech)

* New translations time.mdx (Czech)

* New translations elevation.mdx (Czech)

* New translations extract.mdx (Czech)

* New translations clean.mdx (Czech)

* New translations en.json (Danish)

* New translations faq.mdx (Czech)

* New translations faq.mdx (Czech)

* New translations en.json (Czech)

* New translations files-and-stats.mdx (Czech)

* New translations getting-started.mdx (Czech)

* New translations map-controls.mdx (Czech)

* New translations menu.mdx (Czech)

* New translations toolbar.mdx (Czech)

* New translations files-and-stats.mdx (Czech)

* New translations edit.mdx (Czech)

* New translations view.mdx (Czech)

* New translations files-and-stats.mdx (Czech)

* New translations files-and-stats.mdx (Czech)

* New translations gpx.mdx (Czech)

* New translations gpx.mdx (Czech)

* New translations integration.mdx (Czech)

* New translations view.mdx (Czech)

* New translations map-controls.mdx (Czech)

* New translations integration.mdx (Czech)

* New translations map-controls.mdx (Czech)

* New translations toolbar.mdx (Czech)

* New translations en.json (Czech)

* New translations settings.mdx (Czech)

* New translations en.json (Czech)

* New translations en.json (Czech)

* New translations en.json (Czech)

* New translations en.json (Czech)

* New translations en.json (Czech)

* New translations en.json (Basque)

* New translations files-and-stats.mdx (Basque)

* New translations getting-started.mdx (Basque)

* New translations gpx.mdx (Basque)

* New translations funding.mdx (Basque)

* New translations mapbox.mdx (Basque)

* New translations translation.mdx (Basque)

* New translations integration.mdx (Basque)

* New translations map-controls.mdx (Basque)

* New translations menu.mdx (Basque)

* New translations edit.mdx (Basque)

* New translations file.mdx (Basque)

* New translations settings.mdx (Basque)

* New translations view.mdx (Basque)

* New translations toolbar.mdx (Basque)

* New translations clean.mdx (Basque)

* New translations extract.mdx (Basque)

* New translations merge.mdx (Basque)

* New translations minify.mdx (Basque)

* New translations poi.mdx (Basque)

* New translations routing.mdx (Basque)

* New translations scissors.mdx (Basque)

* New translations time.mdx (Basque)

* New translations faq.mdx (Basque)

* New translations elevation.mdx (Basque)

* New translations settings.mdx (Portuguese)
2025-05-08 13:03:53 +02:00
vcoppe
7fde60a267 upgrade mapbox gl js 2025-04-24 19:42:46 +02:00
vcoppe
306ed2ae0e use correct OSM type for edit link 2025-04-11 18:40:16 +02:00
vcoppe
a7cfe36b2e safer float parsing 2025-04-04 08:56:53 +02:00
vcoppe
f4879a9e8a update routing server url 2025-03-30 20:30:22 +02:00
vcoppe
c8e09fcd90 better handle time updates with weird original data 2025-03-22 15:54:13 +01:00
vcoppe
c5f20d323c copy coordinates button for POIs, closes #195 2025-03-22 14:46:16 +01:00
vcoppe
e3dcdf2f41 New Crowdin updates, closes #198 (#193)
* New translations en.json (Turkish)

* New translations en.json (Polish)

* New translations en.json (Polish)

* New translations gpx.mdx (Hungarian)

* New translations poi.mdx (Hungarian)

* New translations clean.mdx (Polish)

* New translations translation.mdx (Danish)
2025-03-22 14:18:45 +01:00
vcoppe
82d8b5d61e revert 2025-03-22 13:38:07 +01:00
vcoppe
47692656e4 use new routing server 2025-03-22 13:32:45 +01:00
vcoppe
b5bf06b37a format file 2025-02-15 13:09:41 +01:00
vcoppe
bc3b1e5f7c New Crowdin updates (#184)
* New translations en.json (Spanish)

* New translations funding.mdx (Danish)

* New translations mapbox.mdx (Danish)

* New translations translation.mdx (Danish)

* New translations settings.mdx (Danish)
2025-02-15 12:56:16 +01:00
vcoppe
63eae15191 New translations map-controls.mdx (Italian) (#182) 2025-02-07 18:38:06 +01:00
vcoppe
848b6dcef3 catch invalid dates on export, closes #180 2025-02-07 18:13:46 +01:00
vcoppe
dfcdd71057 New Crowdin updates (#179)
* New translations en.json (Catalan)

* New translations en.json (Polish)

* New translations en.json (German)

* New translations files-and-stats.mdx (Italian)

* New translations getting-started.mdx (Italian)

* New translations map-controls.mdx (Italian)

* New translations faq.mdx (Italian)

* New translations en.json (Italian)

* New translations getting-started.mdx (Italian)

* New translations edit.mdx (Italian)

* New translations file.mdx (Italian)

* New translations settings.mdx (Italian)

* New translations view.mdx (Italian)

* New translations routing.mdx (Italian)
2025-02-07 18:06:49 +01:00
vcoppe
7368945bf3 New Crowdin updates (#178)
* New translations files-and-stats.mdx (Catalan)

* New translations map-controls.mdx (Catalan)
2025-02-02 20:58:49 +01:00
vcoppe
de52203e89 add catalan 2025-02-02 20:36:38 +01:00
vcoppe
62d1a3e01f New Crowdin updates (#177)
* New translations files-and-stats.mdx (Catalan)

* New translations files-and-stats.mdx (Catalan)

* New translations gpx.mdx (Catalan)

* New translations en.json (Serbian (Latin))

* New translations en.json (Serbian (Latin))

* New translations files-and-stats.mdx (Serbian (Latin))

* New translations getting-started.mdx (Serbian (Latin))

* New translations gpx.mdx (Serbian (Latin))

* New translations map-controls.mdx (Serbian (Latin))

* New translations menu.mdx (Serbian (Latin))

* New translations edit.mdx (Serbian (Latin))

* New translations view.mdx (Serbian (Latin))

* New translations toolbar.mdx (Serbian (Latin))

* New translations integration.mdx (Catalan)

* New translations integration.mdx (Catalan)

* New translations map-controls.mdx (Catalan)

* New translations view.mdx (Catalan)
2025-02-02 20:36:13 +01:00
vcoppe
68b4ecadf5 New Crowdin updates (#174)
* New translations en.json (Hungarian)

* New translations en.json (Catalan)

* New translations mapbox.mdx (Catalan)

* New translations edit.mdx (Catalan)

* New translations en.json (Catalan)

* New translations edit.mdx (Catalan)

* New translations edit.mdx (Catalan)

* New translations file.mdx (Catalan)

* New translations settings.mdx (Catalan)

* New translations view.mdx (Catalan)

* New translations extract.mdx (Catalan)

* New translations routing.mdx (Catalan)

* New translations elevation.mdx (Catalan)

* New translations menu.mdx (Catalan)

* New translations file.mdx (Catalan)

* New translations merge.mdx (Catalan)

* New translations minify.mdx (Catalan)

* New translations poi.mdx (Catalan)

* New translations routing.mdx (Catalan)

* New translations routing.mdx (Catalan)

* New translations routing.mdx (Catalan)

* New translations routing.mdx (Catalan)

* New translations routing.mdx (Catalan)

* New translations edit.mdx (Catalan)

* New translations poi.mdx (Catalan)

* New translations routing.mdx (Catalan)

* New translations scissors.mdx (Catalan)

* New translations time.mdx (Catalan)

* New translations en.json (Catalan)

* New translations toolbar.mdx (Catalan)

* New translations faq.mdx (Catalan)

* New translations files-and-stats.mdx (Catalan)

* New translations getting-started.mdx (Catalan)

* New translations map-controls.mdx (Catalan)

* New translations menu.mdx (Catalan)

* New translations edit.mdx (Catalan)

* New translations toolbar.mdx (Catalan)

* New translations files-and-stats.mdx (Catalan)

* New translations view.mdx (Catalan)

* New translations en.json (Dutch)

* New translations en.json (Russian)

* New translations en.json (Turkish)

* New translations en.json (German)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Belarusian)

* New translations en.json (Catalan)

* New translations en.json (Czech)

* New translations en.json (Danish)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Hebrew)

* New translations en.json (Hungarian)

* New translations en.json (Italian)

* New translations en.json (Korean)

* New translations en.json (Lithuanian)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (Swedish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Latvian)

* New translations en.json (Serbian (Latin))
2025-02-02 11:53:12 +01:00
vcoppe
7831774703 handle files with uniform timestamps 2025-02-02 11:43:56 +01:00
vcoppe
52984d4b70 handle files with missing timestamps 2025-02-02 11:27:06 +01:00
vcoppe
0b457f9a1e prettier config + format all, closes #175 2025-02-02 11:17:22 +01:00
vcoppe
01cfd448f0 avoid embedding anything else than /embed 2025-01-30 19:25:58 +01:00
vcoppe
c189ebd8ca fix attribution link for OSM layer, part of #176 2025-01-29 18:31:11 +01:00
vcoppe
b35d11c9ed add missing ign fr attribution to custom styles 2025-01-29 18:24:03 +01:00
vcoppe
5fa5908072 use waypoint symbol in file tree 2025-01-26 12:48:23 +01:00
vcoppe
a89f2754d3 New Crowdin updates (#173)
* New translations en.json (Spanish)

* New translations en.json (Czech)

* New translations en.json (Italian)

* New translations en.json (Dutch)
2025-01-25 20:20:13 +01:00
vcoppe
453ae55db0 remember split type, part of #145 2025-01-25 13:35:21 +01:00
vcoppe
c1a5bdd7ae New Crowdin updates (#172)
* New translations en.json (Dutch)

* New translations en.json (Russian)

* New translations en.json (Turkish)

* New translations en.json (German)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Belarusian)

* New translations en.json (Catalan)

* New translations en.json (Czech)

* New translations en.json (Danish)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Hebrew)

* New translations en.json (Hungarian)

* New translations en.json (Italian)

* New translations en.json (Korean)

* New translations en.json (Lithuanian)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (Swedish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Latvian)

* New translations en.json (Serbian (Latin))

* New translations view.mdx (Chinese Simplified)

* Update source file en.json

* New translations en.json (French)
2025-01-25 13:03:57 +01:00
vcoppe
d19e702084 map context menu with coordinates, closes #149 2025-01-25 12:31:12 +01:00
vcoppe
e02a22eaea fix export for gpx files with no attributes 2025-01-25 10:47:47 +01:00
vcoppe
63f3d63518 use filesaver 2025-01-24 20:42:45 +01:00
Anthony
0d03ebfe96 Export multiple files as zip (#153) 2025-01-24 19:57:08 +01:00
vcoppe
074da855c1 New Crowdin updates (#167)
* New translations en.json (Russian)

* New translations en.json (Dutch)

* New translations en.json (Dutch)

* New translations files-and-stats.mdx (Dutch)

* New translations getting-started.mdx (Dutch)

* New translations gpx.mdx (Dutch)

* New translations funding.mdx (Dutch)

* New translations translation.mdx (Dutch)

* New translations integration.mdx (Dutch)

* New translations map-controls.mdx (Dutch)

* New translations edit.mdx (Dutch)

* New translations file.mdx (Dutch)

* New translations settings.mdx (Dutch)

* New translations view.mdx (Dutch)

* New translations extract.mdx (Dutch)

* New translations merge.mdx (Dutch)

* New translations minify.mdx (Dutch)

* New translations scissors.mdx (Dutch)

* New translations time.mdx (Dutch)

* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations integration.mdx (Italian)

* New translations toolbar.mdx (Italian)

* New translations integration.mdx (Italian)

* New translations en.json (German)

* New translations files-and-stats.mdx (German)

* New translations view.mdx (German)

* New translations files-and-stats.mdx (German)
2025-01-24 17:42:58 +01:00
vcoppe
9a028b9d5d support all xml namespaces 2025-01-09 20:45:11 +01:00
vcoppe
a502980a39 New Crowdin updates (#165)
* New translations en.json (Polish)

* New translations en.json (Chinese Simplified)

* New translations getting-started.mdx (Chinese Simplified)

* New translations menu.mdx (Chinese Simplified)

* New translations view.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations edit.mdx (Chinese Simplified)

* New translations file.mdx (Chinese Simplified)

* New translations settings.mdx (Chinese Simplified)

* New translations routing.mdx (Chinese Simplified)

* New translations toolbar.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations poi.mdx (Chinese Simplified)

* New translations time.mdx (Chinese Simplified)

* New translations routing.mdx (Chinese Simplified)

* New translations scissors.mdx (Chinese Simplified)

* New translations merge.mdx (Chinese Simplified)

* New translations extract.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations minify.mdx (Chinese Simplified)

* New translations extract.mdx (Chinese Simplified)

* New translations map-controls.mdx (Chinese Simplified)

* New translations clean.mdx (Chinese Simplified)

* New translations elevation.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations gpx.mdx (Chinese Simplified)

* New translations integration.mdx (Chinese Simplified)

* New translations faq.mdx (Chinese Simplified)

* New translations map-controls.mdx (Chinese Simplified)

* New translations elevation.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)
2025-01-09 09:03:18 +01:00
vcoppe
1a1f6e5131 New Crowdin updates (#164)
* New translations files-and-stats.mdx (Italian)

* New translations elevation.mdx (Italian)
2025-01-05 19:36:38 +01:00
vcoppe
a67501e6de add italian 2025-01-05 19:13:07 +01:00
vcoppe
1f4164aca3 New Crowdin updates (#163)
* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Czech)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)
2025-01-05 19:12:23 +01:00
vcoppe
25e05f9855 fix home link for english 2025-01-04 12:48:58 +01:00
vcoppe
1555799533 New Crowdin updates (#162)
* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations funding.mdx (Chinese Simplified)

* New translations mapbox.mdx (Chinese Simplified)

* New translations translation.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations translation.mdx (Chinese Simplified)

* New translations settings.mdx (Chinese Simplified)
2025-01-04 12:38:08 +01:00
vcoppe
93d5211d27 fix home link for languages other than english 2025-01-03 18:23:48 +01:00
vcoppe
de38fea917 New Crowdin updates (#161)
* New translations clean.mdx (Chinese Simplified)

* New translations en.json (German)
2025-01-03 17:35:31 +01:00
vcoppe
3a3bc1c0db add language 2025-01-03 14:28:34 +01:00
vcoppe
b5871d974e New Crowdin updates (#160)
* New translations view.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations file.mdx (Chinese Simplified)

* New translations routing.mdx (Chinese Simplified)

* New translations scissors.mdx (Chinese Simplified)

* New translations view.mdx (Chinese Simplified)

* New translations elevation.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations elevation.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations settings.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Belarusian)

* New translations en.json (Catalan)

* New translations en.json (Czech)

* New translations en.json (Danish)

* New translations en.json (German)

* New translations en.json (Ukrainian)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Hebrew)

* New translations en.json (Hungarian)

* New translations en.json (Italian)

* New translations en.json (Korean)

* New translations en.json (Lithuanian)

* New translations en.json (Dutch)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Chinese Simplified)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Latvian)

* New translations en.json (Serbian (Latin))

* Update source file en.json

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)
2025-01-03 14:19:47 +01:00
vcoppe
2985c3201b fix localized home link 2025-01-03 14:18:55 +01:00
vcoppe
cf2fcd8221 remove unused color strings 2025-01-03 09:27:50 +01:00
vcoppe
2cb21a43c5 fix tab color when all tracks have a different one 2025-01-02 22:04:14 +01:00
vcoppe
bae0a3f93b handle gpx style attributes without the namespace 2025-01-01 20:01:46 +01:00
vcoppe
a853c45ec7 New Crowdin updates (#158)
* New translations files-and-stats.mdx (Italian)

* New translations map-controls.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations getting-started.mdx (Chinese Simplified)

* New translations edit.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations view.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations edit.mdx (Chinese Simplified)

* New translations funding.mdx (Chinese Simplified)

* New translations edit.mdx (Chinese Simplified)

* New translations en.json (German)

* New translations en.json (Spanish)

* New translations en.json (Dutch)

* New translations files-and-stats.mdx (Spanish)

* New translations files-and-stats.mdx (Dutch)

* New translations getting-started.mdx (Spanish)

* New translations getting-started.mdx (Dutch)

* New translations edit.mdx (Spanish)

* New translations edit.mdx (Dutch)

* New translations view.mdx (Spanish)

* New translations view.mdx (Dutch)

* New translations funding.mdx (Chinese Simplified)

* New translations mapbox.mdx (Chinese Simplified)

* New translations translation.mdx (Chinese Simplified)

* New translations file.mdx (Chinese Simplified)

* New translations settings.mdx (Chinese Simplified)

* New translations settings.mdx (Chinese Simplified)
2025-01-01 14:41:42 +01:00
vcoppe
6cb6c88cd1 fix line weight attribute with correct one: line width 2025-01-01 14:40:28 +01:00
vcoppe
077f2b4435 New Crowdin updates (#157)
* Update source file files-and-stats.mdx

* New translations en.json (Italian)

* New translations files-and-stats.mdx (Romanian)

* New translations files-and-stats.mdx (French)

* New translations files-and-stats.mdx (Spanish)

* New translations files-and-stats.mdx (Belarusian)

* New translations files-and-stats.mdx (Catalan)

* New translations files-and-stats.mdx (Czech)

* New translations files-and-stats.mdx (Danish)

* New translations files-and-stats.mdx (German)

* New translations files-and-stats.mdx (Greek)

* New translations files-and-stats.mdx (Finnish)

* New translations files-and-stats.mdx (Hebrew)

* New translations files-and-stats.mdx (Hungarian)

* New translations files-and-stats.mdx (Italian)

* New translations files-and-stats.mdx (Korean)

* New translations files-and-stats.mdx (Lithuanian)

* New translations files-and-stats.mdx (Dutch)

* New translations files-and-stats.mdx (Norwegian)

* New translations files-and-stats.mdx (Polish)

* New translations files-and-stats.mdx (Portuguese)

* New translations files-and-stats.mdx (Russian)

* New translations files-and-stats.mdx (Swedish)

* New translations files-and-stats.mdx (Turkish)

* New translations files-and-stats.mdx (Ukrainian)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Vietnamese)

* New translations files-and-stats.mdx (Portuguese, Brazilian)

* New translations files-and-stats.mdx (Latvian)

* New translations files-and-stats.mdx (Serbian (Latin))

* Update source file files-and-stats.mdx

* New translations files-and-stats.mdx (French)
2024-12-28 19:44:27 +01:00
vcoppe
8c3c4860f8 fix link 2024-12-28 19:30:58 +01:00
vcoppe
143592f724 New Crowdin updates (#156)
* New translations map-controls.mdx (Chinese Simplified)

* New translations map-controls.mdx (Chinese Simplified)

* New translations gpx.mdx (Chinese Simplified)

* New translations integration.mdx (Chinese Simplified)

* New translations faq.mdx (Chinese Simplified)

* New translations menu.mdx (Chinese Simplified)

* New translations toolbar.mdx (Chinese Simplified)

* New translations getting-started.mdx (Chinese Simplified)

* New translations faq.mdx (Chinese Simplified)

* New translations en.json (Ukrainian)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Belarusian)

* New translations en.json (Catalan)

* New translations en.json (Czech)

* New translations en.json (Danish)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Hebrew)

* New translations en.json (Hungarian)

* New translations en.json (Italian)

* New translations en.json (Korean)

* New translations en.json (Lithuanian)

* New translations en.json (Dutch)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Chinese Simplified)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Latvian)

* New translations en.json (Serbian (Latin))

* New translations files-and-stats.mdx (Romanian)

* New translations files-and-stats.mdx (French)

* New translations files-and-stats.mdx (Spanish)

* New translations files-and-stats.mdx (Belarusian)

* New translations files-and-stats.mdx (Catalan)

* New translations files-and-stats.mdx (Czech)

* New translations files-and-stats.mdx (Danish)

* New translations files-and-stats.mdx (German)

* New translations view.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Greek)

* New translations files-and-stats.mdx (Finnish)

* New translations files-and-stats.mdx (Hebrew)

* New translations files-and-stats.mdx (Hungarian)

* New translations files-and-stats.mdx (Italian)

* New translations files-and-stats.mdx (Korean)

* New translations files-and-stats.mdx (Lithuanian)

* New translations files-and-stats.mdx (Dutch)

* New translations files-and-stats.mdx (Norwegian)

* New translations files-and-stats.mdx (Polish)

* New translations files-and-stats.mdx (Portuguese)

* New translations files-and-stats.mdx (Russian)

* New translations files-and-stats.mdx (Swedish)

* New translations files-and-stats.mdx (Turkish)

* New translations files-and-stats.mdx (Ukrainian)

* New translations files-and-stats.mdx (Chinese Simplified)

* New translations files-and-stats.mdx (Vietnamese)

* New translations files-and-stats.mdx (Portuguese, Brazilian)

* New translations files-and-stats.mdx (Latvian)

* New translations files-and-stats.mdx (Serbian (Latin))

* New translations getting-started.mdx (Romanian)

* New translations getting-started.mdx (French)

* New translations getting-started.mdx (Spanish)

* New translations getting-started.mdx (Belarusian)

* New translations getting-started.mdx (Catalan)

* New translations getting-started.mdx (Czech)

* New translations getting-started.mdx (Danish)

* New translations getting-started.mdx (German)

* New translations getting-started.mdx (Greek)

* New translations getting-started.mdx (Finnish)

* New translations getting-started.mdx (Hebrew)

* New translations getting-started.mdx (Hungarian)

* New translations getting-started.mdx (Italian)

* New translations getting-started.mdx (Korean)

* New translations getting-started.mdx (Lithuanian)

* New translations getting-started.mdx (Dutch)

* New translations getting-started.mdx (Norwegian)

* New translations getting-started.mdx (Polish)

* New translations getting-started.mdx (Portuguese)

* New translations getting-started.mdx (Russian)

* New translations getting-started.mdx (Swedish)

* New translations getting-started.mdx (Turkish)

* New translations getting-started.mdx (Ukrainian)

* New translations getting-started.mdx (Chinese Simplified)

* New translations getting-started.mdx (Vietnamese)

* New translations getting-started.mdx (Portuguese, Brazilian)

* New translations getting-started.mdx (Latvian)

* New translations getting-started.mdx (Serbian (Latin))

* New translations edit.mdx (Romanian)

* New translations edit.mdx (French)

* New translations edit.mdx (Spanish)

* New translations edit.mdx (Belarusian)

* New translations edit.mdx (Catalan)

* New translations edit.mdx (Czech)

* New translations edit.mdx (Danish)

* New translations edit.mdx (German)

* New translations edit.mdx (Greek)

* New translations edit.mdx (Finnish)

* New translations edit.mdx (Hebrew)

* New translations edit.mdx (Hungarian)

* New translations edit.mdx (Italian)

* New translations edit.mdx (Korean)

* New translations edit.mdx (Lithuanian)

* New translations edit.mdx (Dutch)

* New translations edit.mdx (Norwegian)

* New translations edit.mdx (Polish)

* New translations edit.mdx (Portuguese)

* New translations edit.mdx (Russian)

* New translations edit.mdx (Swedish)

* New translations edit.mdx (Turkish)

* New translations edit.mdx (Ukrainian)

* New translations edit.mdx (Chinese Simplified)

* New translations edit.mdx (Vietnamese)

* New translations edit.mdx (Portuguese, Brazilian)

* New translations edit.mdx (Latvian)

* New translations edit.mdx (Serbian (Latin))

* New translations view.mdx (Romanian)

* New translations view.mdx (French)

* New translations view.mdx (Spanish)

* New translations view.mdx (Belarusian)

* New translations view.mdx (Catalan)

* New translations view.mdx (Czech)

* New translations view.mdx (Danish)

* New translations view.mdx (German)

* New translations view.mdx (Greek)

* New translations view.mdx (Finnish)

* New translations view.mdx (Hebrew)

* New translations view.mdx (Hungarian)

* New translations view.mdx (Italian)

* New translations view.mdx (Korean)

* New translations view.mdx (Lithuanian)

* New translations view.mdx (Dutch)

* New translations view.mdx (Norwegian)

* New translations view.mdx (Polish)

* New translations view.mdx (Portuguese)

* New translations view.mdx (Russian)

* New translations view.mdx (Swedish)

* New translations view.mdx (Turkish)

* New translations view.mdx (Ukrainian)

* New translations view.mdx (Vietnamese)

* New translations view.mdx (Portuguese, Brazilian)

* New translations view.mdx (Latvian)

* New translations view.mdx (Serbian (Latin))

* Update source file en.json

* Update source file files-and-stats.mdx

* Update source file getting-started.mdx

* Update source file edit.mdx

* Update source file view.mdx

* New translations en.json (French)

* New translations files-and-stats.mdx (French)

* New translations getting-started.mdx (French)

* New translations edit.mdx (French)

* New translations view.mdx (French)

* New translations view.mdx (Italian)
2024-12-28 19:22:36 +01:00
vcoppe
dc404706c5 detect and ignore duplicate POIs when merging 2024-12-28 16:14:36 +01:00
vcoppe
7a80e9e104 rename "vertical file list" to "file tree" 2024-12-28 15:52:29 +01:00
vcoppe
d7aae81c41 fix style extension handling 2024-12-28 15:16:32 +01:00
vcoppe
745c7e8470 New translations map-controls.mdx (Chinese Simplified) (#155) 2024-12-24 17:07:22 +01:00
vcoppe
52623350bd New Crowdin updates (#140)
* New translations en.json (German)

* New translations en.json (German)

* New translations minify.mdx (German)

* New translations en.json (Belarusian)

* New translations en.json (Belarusian)

* New translations en.json (Belarusian)

* New translations en.json (Spanish)

* New translations en.json (Spanish)

* New translations en.json (Chinese Simplified)

* New translations en.json (Serbian (Latin))

* New translations en.json (Serbian (Latin))

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* New translations en.json (Serbian (Latin))

* New translations translation.mdx (Chinese Simplified)

* New translations settings.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations translation.mdx (Chinese Simplified)

* New translations funding.mdx (Chinese Simplified)

* New translations map-controls.mdx (Chinese Simplified)

* New translations menu.mdx (Chinese Simplified)

* New translations toolbar.mdx (Chinese Simplified)

* New translations translation.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations funding.mdx (Chinese Simplified)

* New translations elevation.mdx (Chinese Simplified)

* New translations translation.mdx (Chinese Simplified)

* New translations mapbox.mdx (Chinese Simplified)

* New translations funding.mdx (Chinese Simplified)

* New translations gpx.mdx (Chinese Simplified)

* New translations edit.mdx (Chinese Simplified)

* New translations file.mdx (Chinese Simplified)

* New translations settings.mdx (Chinese Simplified)

* New translations elevation.mdx (Chinese Simplified)

* New translations view.mdx (Chinese Simplified)

* New translations clean.mdx (Chinese Simplified)

* New translations extract.mdx (Chinese Simplified)

* New translations merge.mdx (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations funding.mdx (Chinese Simplified)

* New translations menu.mdx (Chinese Simplified)

* New translations toolbar.mdx (Chinese Simplified)

* New translations merge.mdx (Chinese Simplified)

* New translations minify.mdx (Chinese Simplified)

* New translations poi.mdx (Chinese Simplified)

* New translations faq.mdx (Chinese Simplified)

* New translations getting-started.mdx (Chinese Simplified)

* New translations en.json (Catalan)

* New translations en.json (Belarusian)

* New translations en.json (Norwegian)

* New translations en.json (Norwegian)

* New translations mapbox.mdx (Catalan)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hungarian)

* New translations en.json (Hungarian)

* New translations files-and-stats.mdx (Hungarian)

* New translations getting-started.mdx (Hungarian)

* New translations integration.mdx (Hungarian)

* New translations map-controls.mdx (Hungarian)

* New translations menu.mdx (Hungarian)

* New translations edit.mdx (Hungarian)

* New translations settings.mdx (Hungarian)

* New translations view.mdx (Hungarian)

* New translations toolbar.mdx (Hungarian)

* New translations routing.mdx (Hungarian)

* New translations scissors.mdx (Hungarian)

* New translations time.mdx (Hungarian)

* New translations en.json (Vietnamese)

* New translations translation.mdx (Vietnamese)

* New translations settings.mdx (Vietnamese)

* New translations funding.mdx (Vietnamese)

* New translations map-controls.mdx (Belarusian)

* New translations view.mdx (Belarusian)

* New translations map-controls.mdx (Belarusian)

* New translations integration.mdx (Belarusian)

* New translations integration.mdx (Belarusian)

* New translations gpx.mdx (Belarusian)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations poi.mdx (Chinese Simplified)

* New translations time.mdx (Chinese Simplified)

* New translations poi.mdx (Chinese Simplified)

* New translations time.mdx (Chinese Simplified)

* New translations routing.mdx (Chinese Simplified)

* New translations scissors.mdx (Chinese Simplified)

* New translations routing.mdx (Chinese Simplified)

* New translations poi.mdx (Chinese Simplified)

* New translations time.mdx (Chinese Simplified)

* New translations routing.mdx (Chinese Simplified)

* New translations scissors.mdx (Chinese Simplified)

* New translations merge.mdx (Chinese Simplified)

* New translations minify.mdx (Chinese Simplified)

* New translations extract.mdx (Chinese Simplified)

* New translations extract.mdx (Chinese Simplified)

* New translations map-controls.mdx (Chinese Simplified)

* New translations menu.mdx (Chinese Simplified)

* New translations view.mdx (Chinese Simplified)

* New translations toolbar.mdx (Chinese Simplified)

* New translations clean.mdx (Chinese Simplified)

* New translations elevation.mdx (Chinese Simplified)

* New translations faq.mdx (Italian)
2024-12-24 16:51:29 +01:00
vcoppe
7d2c030ebd update Mapbox GL JS, closes #129 2024-12-24 16:50:52 +01:00
vcoppe
b841326e19 finer tolerances for minify tool, closes #150 2024-12-24 16:40:48 +01:00
vcoppe
23c41f18de use new toilet icon, closes #100 2024-11-18 21:08:30 +01:00
vcoppe
44e11e1a51 back to globe projection 2024-10-23 13:50:28 +02:00
vcoppe
798d8e7a14 add german 2024-10-21 23:27:19 +02:00
vcoppe
29748cf114 New translations integration.mdx (German) (#139) 2024-10-21 23:26:57 +02:00
vcoppe
f5794b1355 New Crowdin updates (#132)
* New translations en.json (Italian)

* New translations funding.mdx (Czech)

* New translations mapbox.mdx (Czech)

* New translations translation.mdx (Czech)

* New translations edit.mdx (Czech)

* New translations settings.mdx (Czech)

* New translations edit.mdx (Polish)

* New translations funding.mdx (Italian)

* New translations edit.mdx (Italian)

* New translations elevation.mdx (Italian)

* New translations en.json (Catalan)

* New translations en.json (Italian)

* New translations files-and-stats.mdx (Italian)

* New translations edit.mdx (Italian)

* New translations file.mdx (Catalan)

* New translations file.mdx (Italian)

* New translations extract.mdx (Catalan)

* New translations routing.mdx (Italian)

* New translations en.json (Catalan)

* New translations files-and-stats.mdx (Catalan)

* New translations getting-started.mdx (Catalan)

* New translations mapbox.mdx (Catalan)

* New translations settings.mdx (Catalan)

* New translations view.mdx (Catalan)

* New translations faq.mdx (Catalan)

* New translations en.json (Catalan)

* New translations files-and-stats.mdx (Italian)

* New translations getting-started.mdx (Italian)

* New translations funding.mdx (Italian)

* New translations view.mdx (Catalan)

* New translations view.mdx (Italian)

* New translations en.json (Catalan)

* New translations en.json (Catalan)

* New translations files-and-stats.mdx (Catalan)

* New translations en.json (Hebrew)

* New translations files-and-stats.mdx (Catalan)

* New translations en.json (Hebrew)

* New translations gpx.mdx (German)

* New translations en.json (German)

* New translations en.json (German)

* New translations funding.mdx (Hebrew)

* New translations en.json (Dutch)

* New translations edit.mdx (German)

* New translations extract.mdx (German)

* New translations elevation.mdx (German)

* New translations en.json (German)

* New translations extract.mdx (German)

* New translations en.json (Italian)

* New translations en.json (Italian)

* New translations files-and-stats.mdx (Italian)

* New translations getting-started.mdx (Italian)

* New translations minify.mdx (Italian)

* New translations poi.mdx (Italian)

* New translations routing.mdx (Italian)

* New translations en.json (Czech)

* New translations en.json (French)

* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (Czech)

* New translations file.mdx (Czech)

* New translations settings.mdx (Czech)

* New translations routing.mdx (Czech)

* New translations en.json (German)

* New translations mapbox.mdx (German)

* New translations en.json (German)

* New translations en.json (Turkish)

* New translations files-and-stats.mdx (Turkish)

* New translations getting-started.mdx (Turkish)

* New translations gpx.mdx (Turkish)

* New translations funding.mdx (Turkish)

* New translations mapbox.mdx (Turkish)

* New translations translation.mdx (Turkish)

* New translations integration.mdx (Turkish)

* New translations map-controls.mdx (Turkish)

* New translations menu.mdx (Turkish)

* New translations edit.mdx (Turkish)

* New translations file.mdx (Turkish)

* New translations settings.mdx (Turkish)

* New translations view.mdx (Turkish)

* New translations toolbar.mdx (Turkish)

* New translations clean.mdx (Turkish)

* New translations extract.mdx (Turkish)

* New translations merge.mdx (Turkish)

* New translations minify.mdx (Turkish)

* New translations poi.mdx (Turkish)

* New translations routing.mdx (Turkish)

* New translations scissors.mdx (Turkish)

* New translations time.mdx (Turkish)

* New translations faq.mdx (Turkish)

* New translations elevation.mdx (Turkish)

* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations en.json (Russian)

* New translations en.json (Ukrainian)

* New translations files-and-stats.mdx (Ukrainian)

* New translations getting-started.mdx (Ukrainian)

* New translations gpx.mdx (Ukrainian)

* New translations funding.mdx (Ukrainian)

* New translations mapbox.mdx (Ukrainian)

* New translations translation.mdx (Ukrainian)

* New translations integration.mdx (Ukrainian)

* New translations map-controls.mdx (Ukrainian)

* New translations menu.mdx (Ukrainian)

* New translations edit.mdx (Ukrainian)

* New translations file.mdx (Ukrainian)

* New translations settings.mdx (Ukrainian)

* New translations view.mdx (Ukrainian)

* New translations toolbar.mdx (Ukrainian)

* New translations clean.mdx (Ukrainian)

* New translations extract.mdx (Ukrainian)

* New translations merge.mdx (Ukrainian)

* New translations minify.mdx (Ukrainian)

* New translations poi.mdx (Ukrainian)

* New translations routing.mdx (Ukrainian)

* New translations scissors.mdx (Ukrainian)

* New translations time.mdx (Ukrainian)

* New translations faq.mdx (Ukrainian)

* New translations elevation.mdx (Ukrainian)

* New translations en.json (Ukrainian)

* New translations merge.mdx (German)

* New translations en.json (German)

* New translations gpx.mdx (German)

* New translations edit.mdx (German)

* New translations extract.mdx (German)

* New translations en.json (Ukrainian)

* New translations merge.mdx (German)

* New translations files-and-stats.mdx (German)

* New translations getting-started.mdx (German)

* New translations funding.mdx (German)

* New translations integration.mdx (German)

* New translations map-controls.mdx (German)

* New translations view.mdx (German)

* New translations toolbar.mdx (German)

* New translations minify.mdx (German)

* New translations poi.mdx (German)

* New translations routing.mdx (German)

* New translations scissors.mdx (German)

* New translations faq.mdx (German)

* New translations en.json (German)

* New translations funding.mdx (German)
2024-10-21 23:08:45 +02:00
714 changed files with 32847 additions and 35002 deletions

16
.prettierrc Normal file
View File

@@ -0,0 +1,16 @@
{
"useTabs": false,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"overrides": [
{
"files": "**/*.svelte",
"options": {
"plugins": ["prettier-plugin-svelte"],
"parser": "svelte"
}
}
]
}

7
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"svelte.svelte-vscode"
]
}

13
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
}
}

1
gpx/.prettierignore Normal file
View File

@@ -0,0 +1 @@
package-lock.json

1617
gpx/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -12,16 +12,20 @@
"private": true, "private": true,
"dependencies": { "dependencies": {
"fast-xml-parser": "^4.5.0", "fast-xml-parser": "^4.5.0",
"immer": "^10.1.1", "immer": "^10.1.1"
"ts-node": "^10.9.2"
}, },
"devDependencies": { "devDependencies": {
"@types/geojson": "^7946.0.14", "@types/geojson": "^7946.0.14",
"@types/node": "^20.16.10", "@types/node": "^20.16.10",
"@typescript-eslint/parser": "^8.22.0",
"prettier": "^3.4.2",
"ts-node": "^10.9.2",
"typescript": "^5.6.2" "typescript": "^5.6.2"
}, },
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"postinstall": "npm run build" "postinstall": "npm run build",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -2,4 +2,3 @@ export * from './gpx';
export { Coordinates, LineStyleExtension, WaypointType } from './types'; export { Coordinates, LineStyleExtension, WaypointType } from './types';
export { parseGPX, buildGPX } from './io'; export { parseGPX, buildGPX } from './io';
export * from './simplify'; export * from './simplify';

View File

@@ -1,25 +1,68 @@
import { XMLParser, XMLBuilder } from "fast-xml-parser"; import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import { GPXFileType } from "./types"; import { GPXFileType } from './types';
import { GPXFile } from "./gpx"; import { GPXFile } from './gpx';
const attributesWithNamespace = {
RoutePointExtension: 'gpxx:RoutePointExtension',
rpt: 'gpxx:rpt',
TrackPointExtension: 'gpxtpx:TrackPointExtension',
PowerExtension: 'gpxpx:PowerExtension',
atemp: 'gpxtpx:atemp',
hr: 'gpxtpx:hr',
cad: 'gpxtpx:cad',
Extensions: 'gpxtpx:Extensions',
PowerInWatts: 'gpxpx:PowerInWatts',
power: 'gpxpx:PowerExtension',
line: 'gpx_style:line',
color: 'gpx_style:color',
opacity: 'gpx_style:opacity',
width: 'gpx_style:width',
};
const floatPatterns = [
/[-+]?\d*\.\d+$/, // decimal
/[-+]?\d+$/, // integer
];
function safeParseFloat(value: string): number {
const parsed = parseFloat(value);
if (!isNaN(parsed)) {
return parsed;
}
for (const pattern of floatPatterns) {
const match = value.match(pattern);
if (match) {
return parseFloat(match[0]);
}
}
return 0.0;
}
export function parseGPX(gpxData: string): GPXFile { export function parseGPX(gpxData: string): GPXFile {
const parser = new XMLParser({ const parser = new XMLParser({
ignoreAttributes: false, ignoreAttributes: false,
attributeNamePrefix: "", attributeNamePrefix: '',
attributesGroupName: 'attributes', attributesGroupName: 'attributes',
removeNSPrefix: true,
isArray(name: string) { isArray(name: string) {
return name === 'trk' || name === 'trkseg' || name === 'trkpt' || name === 'wpt' || name === 'rte' || name === 'rtept' || name === 'gpxx:rpt'; return (
name === 'trk' ||
name === 'trkseg' ||
name === 'trkpt' ||
name === 'wpt' ||
name === 'rte' ||
name === 'rtept' ||
name === 'gpxx:rpt'
);
}, },
attributeValueProcessor(attrName, attrValue, jPath) { attributeValueProcessor(attrName, attrValue, jPath) {
if (attrName === 'lat' || attrName === 'lon') { if (attrName === 'lat' || attrName === 'lon') {
return parseFloat(attrValue); return safeParseFloat(attrValue);
} }
return attrValue; return attrValue;
}, },
transformTagName(tagName: string) { transformTagName(tagName: string) {
if (tagName === 'power') { if (attributesWithNamespace[tagName]) {
// Transform the simple <power> tag to the more complex <gpxpx:PowerExtension> tag, the nested <gpxpx:PowerInWatts> tag is then handled by the tagValueProcessor return attributesWithNamespace[tagName];
return 'gpxpx:PowerExtension';
} }
return tagName; return tagName;
}, },
@@ -27,22 +70,29 @@ export function parseGPX(gpxData: string): GPXFile {
tagValueProcessor(tagName, tagValue, jPath, hasAttributes, isLeafNode) { tagValueProcessor(tagName, tagValue, jPath, hasAttributes, isLeafNode) {
if (isLeafNode) { if (isLeafNode) {
if (tagName === 'ele') { if (tagName === 'ele') {
return parseFloat(tagValue); return safeParseFloat(tagValue);
} }
if (tagName === 'time') { if (tagName === 'time') {
return new Date(tagValue); return new Date(tagValue);
} }
if (tagName === 'gpxtpx:atemp' || tagName === 'gpxtpx:hr' || tagName === 'gpxtpx:cad' || tagName === 'gpxpx:PowerInWatts' || tagName === 'opacity' || tagName === 'weight') { if (
return parseFloat(tagValue); tagName === 'gpxtpx:atemp' ||
tagName === 'gpxtpx:hr' ||
tagName === 'gpxtpx:cad' ||
tagName === 'gpxpx:PowerInWatts' ||
tagName === 'gpx_style:opacity' ||
tagName === 'gpx_style:width'
) {
return safeParseFloat(tagValue);
} }
if (tagName === 'gpxpx:PowerExtension') { if (tagName === 'gpxpx:PowerExtension') {
// Finish the transformation of the simple <power> tag to the more complex <gpxpx:PowerExtension> tag // Finish the transformation of the simple <power> tag to the more complex <gpxpx:PowerExtension> tag
// Note that this only targets the transformed <power> tag, since it must be a leaf node // Note that this only targets the transformed <power> tag, since it must be a leaf node
return { return {
'gpxpx:PowerInWatts': parseFloat(tagValue) 'gpxpx:PowerInWatts': safeParseFloat(tagValue),
}; };
} }
} }
@@ -54,7 +104,7 @@ export function parseGPX(gpxData: string): GPXFile {
const parsed: GPXFileType = parser.parse(gpxData).gpx; const parsed: GPXFileType = parser.parse(gpxData).gpx;
// @ts-ignore // @ts-ignore
if (parsed.metadata === "") { if (parsed.metadata === '') {
parsed.metadata = {}; parsed.metadata = {};
} }
@@ -64,25 +114,32 @@ export function parseGPX(gpxData: string): GPXFile {
export function buildGPX(file: GPXFile, exclude: string[]): string { export function buildGPX(file: GPXFile, exclude: string[]): string {
const gpx = file.toGPXFileType(exclude); const gpx = file.toGPXFileType(exclude);
let lastDate = undefined;
const builder = new XMLBuilder({ const builder = new XMLBuilder({
format: true, format: true,
ignoreAttributes: false, ignoreAttributes: false,
attributeNamePrefix: "", attributeNamePrefix: '',
attributesGroupName: 'attributes', attributesGroupName: 'attributes',
suppressEmptyNode: true, suppressEmptyNode: true,
tagValueProcessor: (tagName: string, tagValue: unknown): string => { tagValueProcessor: (tagName: string, tagValue: unknown): string | undefined => {
if (tagValue instanceof Date) { if (tagValue instanceof Date) {
if (isNaN(tagValue.getTime())) {
return lastDate?.toISOString();
}
lastDate = tagValue;
return tagValue.toISOString(); return tagValue.toISOString();
} }
return tagValue.toString(); return tagValue.toString();
}, },
}); });
gpx.attributes.creator = gpx.attributes.creator ?? 'https://gpx.studio'; if (!gpx.attributes) gpx.attributes = {};
gpx.attributes['creator'] = gpx.attributes['creator'] ?? 'https://gpx.studio';
gpx.attributes['version'] = '1.1'; gpx.attributes['version'] = '1.1';
gpx.attributes['xmlns'] = 'http://www.topografix.com/GPX/1/1'; gpx.attributes['xmlns'] = 'http://www.topografix.com/GPX/1/1';
gpx.attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance'; gpx.attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance';
gpx.attributes['xsi:schemaLocation'] = 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/PowerExtension/v1 http://www.garmin.com/xmlschemas/PowerExtensionv1.xsd http://www.topografix.com/GPX/gpx_style/0/2 http://www.topografix.com/GPX/gpx_style/0/2/gpx_style.xsd'; gpx.attributes['xsi:schemaLocation'] =
'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/PowerExtension/v1 http://www.garmin.com/xmlschemas/PowerExtensionv1.xsd http://www.topografix.com/GPX/gpx_style/0/2 http://www.topografix.com/GPX/gpx_style/0/2/gpx_style.xsd';
gpx.attributes['xmlns:gpxtpx'] = 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1'; gpx.attributes['xmlns:gpxtpx'] = 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1';
gpx.attributes['xmlns:gpxx'] = 'http://www.garmin.com/xmlschemas/GpxExtensions/v3'; gpx.attributes['xmlns:gpxx'] = 'http://www.garmin.com/xmlschemas/GpxExtensions/v3';
gpx.attributes['xmlns:gpxpx'] = 'http://www.garmin.com/xmlschemas/PowerExtension/v1'; gpx.attributes['xmlns:gpxpx'] = 'http://www.garmin.com/xmlschemas/PowerExtension/v1';
@@ -93,19 +150,24 @@ export function buildGPX(file: GPXFile, exclude: string[]): string {
} }
return builder.build({ return builder.build({
"?xml": { '?xml': {
attributes: { attributes: {
version: "1.0", version: '1.0',
encoding: "UTF-8", encoding: 'UTF-8',
}
}, },
gpx: removeEmptyElements(gpx) },
gpx: removeEmptyElements(gpx),
}); });
} }
function removeEmptyElements(obj: GPXFileType): GPXFileType { function removeEmptyElements(obj: GPXFileType): GPXFileType {
for (const key in obj) { for (const key in obj) {
if (obj[key] === null || obj[key] === undefined || obj[key] === '' || (Array.isArray(obj[key]) && obj[key].length === 0)) { if (
obj[key] === null ||
obj[key] === undefined ||
obj[key] === '' ||
(Array.isArray(obj[key]) && obj[key].length === 0)
) {
delete obj[key]; delete obj[key];
} else if (typeof obj[key] === 'object' && !(obj[key] instanceof Date)) { } else if (typeof obj[key] === 'object' && !(obj[key] instanceof Date)) {
removeEmptyElements(obj[key]); removeEmptyElements(obj[key]);

View File

@@ -1,33 +1,48 @@
import { TrackPoint } from "./gpx"; import { TrackPoint } from './gpx';
import { Coordinates } from "./types"; import { Coordinates } from './types';
export type SimplifiedTrackPoint = { point: TrackPoint, distance?: number }; export type SimplifiedTrackPoint = { point: TrackPoint; distance?: number };
const earthRadius = 6371008.8; const earthRadius = 6371008.8;
export function ramerDouglasPeucker(points: TrackPoint[], epsilon: number = 50, measure: (a: TrackPoint, b: TrackPoint, c: TrackPoint) => number = crossarcDistance): SimplifiedTrackPoint[] { export function ramerDouglasPeucker(
points: TrackPoint[],
epsilon: number = 50,
measure: (a: TrackPoint, b: TrackPoint, c: TrackPoint) => number = crossarcDistance
): SimplifiedTrackPoint[] {
if (points.length == 0) { if (points.length == 0) {
return []; return [];
} else if (points.length == 1) { } else if (points.length == 1) {
return [{ return [
point: points[0] {
}]; point: points[0],
},
];
} }
let simplified = [{ let simplified = [
point: points[0] {
}]; point: points[0],
},
];
ramerDouglasPeuckerRecursive(points, epsilon, measure, 0, points.length - 1, simplified); ramerDouglasPeuckerRecursive(points, epsilon, measure, 0, points.length - 1, simplified);
simplified.push({ simplified.push({
point: points[points.length - 1] point: points[points.length - 1],
}); });
return simplified; return simplified;
} }
function ramerDouglasPeuckerRecursive(points: TrackPoint[], epsilon: number, measure: (a: TrackPoint, b: TrackPoint, c: TrackPoint) => number, start: number, end: number, simplified: SimplifiedTrackPoint[]) { function ramerDouglasPeuckerRecursive(
points: TrackPoint[],
epsilon: number,
measure: (a: TrackPoint, b: TrackPoint, c: TrackPoint) => number,
start: number,
end: number,
simplified: SimplifiedTrackPoint[]
) {
let largest = { let largest = {
index: 0, index: 0,
distance: 0 distance: 0,
}; };
for (let i = start + 1; i < end; i++) { for (let i = start + 1; i < end; i++) {
@@ -45,8 +60,16 @@ function ramerDouglasPeuckerRecursive(points: TrackPoint[], epsilon: number, mea
} }
} }
export function crossarcDistance(point1: TrackPoint, point2: TrackPoint, point3: TrackPoint | Coordinates): number { export function crossarcDistance(
return crossarc(point1.getCoordinates(), point2.getCoordinates(), point3 instanceof TrackPoint ? point3.getCoordinates() : point3); point1: TrackPoint,
point2: TrackPoint,
point3: TrackPoint | Coordinates
): number {
return crossarc(
point1.getCoordinates(),
point2.getCoordinates(),
point3 instanceof TrackPoint ? point3.getCoordinates() : point3
);
} }
function crossarc(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates): number { function crossarc(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates): number {
@@ -74,7 +97,7 @@ function crossarc(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates)
} }
// Is relative bearing obtuse? // Is relative bearing obtuse?
if (diff > (Math.PI / 2)) { if (diff > Math.PI / 2) {
return dis13; return dis13;
} }
@@ -83,7 +106,8 @@ function crossarc(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates)
// Is p4 beyond the arc? // Is p4 beyond the arc?
let dis12 = distance(lat1, lon1, lat2, lon2); let dis12 = distance(lat1, lon1, lat2, lon2);
let dis14 = Math.acos(Math.cos(dis13 / earthRadius) / Math.cos(dxt / earthRadius)) * earthRadius; let dis14 =
Math.acos(Math.cos(dis13 / earthRadius) / Math.cos(dxt / earthRadius)) * earthRadius;
if (dis14 > dis12) { if (dis14 > dis12) {
return distance(lat2, lon2, lat3, lon3); return distance(lat2, lon2, lat3, lon3);
} else { } else {
@@ -93,18 +117,32 @@ function crossarc(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates)
function distance(latA: number, lonA: number, latB: number, lonB: number): number { function distance(latA: number, lonA: number, latB: number, lonB: number): number {
// Finds the distance between two lat / lon points. // Finds the distance between two lat / lon points.
return Math.acos(Math.sin(latA) * Math.sin(latB) + Math.cos(latA) * Math.cos(latB) * Math.cos(lonB - lonA)) * earthRadius; return (
Math.acos(
Math.sin(latA) * Math.sin(latB) +
Math.cos(latA) * Math.cos(latB) * Math.cos(lonB - lonA)
) * earthRadius
);
} }
function bearing(latA: number, lonA: number, latB: number, lonB: number): number { function bearing(latA: number, lonA: number, latB: number, lonB: number): number {
// Finds the bearing from one lat / lon point to another. // Finds the bearing from one lat / lon point to another.
return Math.atan2(Math.sin(lonB - lonA) * Math.cos(latB), return Math.atan2(
Math.cos(latA) * Math.sin(latB) - Math.sin(latA) * Math.cos(latB) * Math.cos(lonB - lonA)); Math.sin(lonB - lonA) * Math.cos(latB),
Math.cos(latA) * Math.sin(latB) - Math.sin(latA) * Math.cos(latB) * Math.cos(lonB - lonA)
);
} }
export function projectedPoint(point1: TrackPoint, point2: TrackPoint, point3: TrackPoint | Coordinates): Coordinates { export function projectedPoint(
return projected(point1.getCoordinates(), point2.getCoordinates(), point3 instanceof TrackPoint ? point3.getCoordinates() : point3); point1: TrackPoint,
point2: TrackPoint,
point3: TrackPoint | Coordinates
): Coordinates {
return projected(
point1.getCoordinates(),
point2.getCoordinates(),
point3 instanceof TrackPoint ? point3.getCoordinates() : point3
);
} }
function projected(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates): Coordinates { function projected(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates): Coordinates {
@@ -132,7 +170,7 @@ function projected(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates
} }
// Is relative bearing obtuse? // Is relative bearing obtuse?
if (diff > (Math.PI / 2)) { if (diff > Math.PI / 2) {
return coord1; return coord1;
} }
@@ -141,14 +179,22 @@ function projected(coord1: Coordinates, coord2: Coordinates, coord3: Coordinates
// Is p4 beyond the arc? // Is p4 beyond the arc?
let dis12 = distance(lat1, lon1, lat2, lon2); let dis12 = distance(lat1, lon1, lat2, lon2);
let dis14 = Math.acos(Math.cos(dis13 / earthRadius) / Math.cos(dxt / earthRadius)) * earthRadius; let dis14 =
Math.acos(Math.cos(dis13 / earthRadius) / Math.cos(dxt / earthRadius)) * earthRadius;
if (dis14 > dis12) { if (dis14 > dis12) {
return coord2; return coord2;
} else { } else {
// Determine the closest point (p4) on the great circle // Determine the closest point (p4) on the great circle
const f = dis14 / earthRadius; const f = dis14 / earthRadius;
const lat4 = Math.asin(Math.sin(lat1) * Math.cos(f) + Math.cos(lat1) * Math.sin(f) * Math.cos(bear12)); const lat4 = Math.asin(
const lon4 = lon1 + Math.atan2(Math.sin(bear12) * Math.sin(f) * Math.cos(lat1), Math.cos(f) - Math.sin(lat1) * Math.sin(lat4)); Math.sin(lat1) * Math.cos(f) + Math.cos(lat1) * Math.sin(f) * Math.cos(bear12)
);
const lon4 =
lon1 +
Math.atan2(
Math.sin(bear12) * Math.sin(f) * Math.cos(lat1),
Math.cos(f) - Math.sin(lat1) * Math.sin(lat4)
);
return { lat: lat4 / rad, lon: lon4 / rad }; return { lat: lat4 / rad, lon: lon4 / rad };
} }

View File

@@ -67,9 +67,9 @@ export type TrackExtensions = {
}; };
export type LineStyleExtension = { export type LineStyleExtension = {
color?: string; 'gpx_style:color'?: string;
opacity?: number; 'gpx_style:opacity'?: number;
weight?: number; 'gpx_style:width'?: number;
}; };
export type TrackSegmentType = { export type TrackSegmentType = {
@@ -93,11 +93,11 @@ export type TrackPointExtension = {
'gpxtpx:hr'?: number; 'gpxtpx:hr'?: number;
'gpxtpx:cad'?: number; 'gpxtpx:cad'?: number;
'gpxtpx:Extensions'?: Record<string, string>; 'gpxtpx:Extensions'?: Record<string, string>;
} };
export type PowerExtension = { export type PowerExtension = {
'gpxpx:PowerInWatts'?: number; 'gpxpx:PowerInWatts'?: number;
} };
export type Author = { export type Author = {
name?: string; name?: string;
@@ -114,12 +114,12 @@ export type RouteType = {
type?: string; type?: string;
extensions?: TrackExtensions; extensions?: TrackExtensions;
rtept: WaypointType[]; rtept: WaypointType[];
} };
export type RoutePointExtension = { export type RoutePointExtension = {
'gpxx:rpt'?: GPXXRoutePoint[]; 'gpxx:rpt'?: GPXXRoutePoint[];
} };
export type GPXXRoutePoint = { export type GPXXRoutePoint = {
attributes: Coordinates; attributes: Coordinates;
} };

View File

@@ -16,9 +16,9 @@
<type>Cycling</type> <type>Cycling</type>
<extensions> <extensions>
<gpx_style:line> <gpx_style:line>
<color>#2d3ee9</color> <gpx_style:color>2d3ee9</gpx_style:color>
<opacity>0.5</opacity> <gpx_style:opacity>0.5</gpx_style:opacity>
<weight>6</weight> <gpx_style:width>6</gpx_style:width>
</gpx_style:line> </gpx_style:line>
</extensions> </extensions>
<trkseg> <trkseg>

View File

@@ -4,9 +4,7 @@
"target": "ES2015", "target": "ES2015",
"declaration": true, "declaration": true,
"outDir": "./dist", "outDir": "./dist",
"moduleResolution": "node", "moduleResolution": "node"
}, },
"include": [ "include": ["src"]
"src"
],
} }

View File

@@ -5,27 +5,27 @@ module.exports = {
'eslint:recommended', 'eslint:recommended',
'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended', 'plugin:svelte/recommended',
'prettier' 'prettier',
], ],
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'], plugins: ['@typescript-eslint'],
parserOptions: { parserOptions: {
sourceType: 'module', sourceType: 'module',
ecmaVersion: 2020, ecmaVersion: 2020,
extraFileExtensions: ['.svelte'] extraFileExtensions: ['.svelte'],
}, },
env: { env: {
browser: true, browser: true,
es2017: true, es2017: true,
node: true node: true,
}, },
overrides: [ overrides: [
{ {
files: ['*.svelte'], files: ['*.svelte'],
parser: 'svelte-eslint-parser', parser: 'svelte-eslint-parser',
parserOptions: { parserOptions: {
parser: '@typescript-eslint/parser' parser: '@typescript-eslint/parser',
} },
} },
] ],
}; };

View File

@@ -2,3 +2,5 @@
pnpm-lock.yaml pnpm-lock.yaml
package-lock.json package-lock.json
yarn.lock yarn.lock
src/lib/components/ui
*.mdx

View File

@@ -1,8 +0,0 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}

1337
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,7 @@
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "vite build",
"prebuild": "npx tsx src/lib/pwa-manifest.ts",
"postbuild": "npx tsx src/lib/sitemap.ts", "postbuild": "npx tsx src/lib/sitemap.ts",
"preview": "vite preview", "preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
@@ -20,7 +21,7 @@
"@sveltejs/vite-plugin-svelte": "^3.1.2", "@sveltejs/vite-plugin-svelte": "^3.1.2",
"@types/eslint": "^8.56.12", "@types/eslint": "^8.56.12",
"@types/events": "^3.0.3", "@types/events": "^3.0.3",
"@types/mapbox__mapbox-gl-geocoder": "^5.0.0", "@types/file-saver": "^2.0.7",
"@types/mapbox__tilebelt": "^1.0.4", "@types/mapbox__tilebelt": "^1.0.4",
"@types/mapbox-gl": "^3.4.0", "@types/mapbox-gl": "^3.4.0",
"@types/node": "^20.16.10", "@types/node": "^20.16.10",
@@ -35,7 +36,7 @@
"eslint-plugin-svelte": "^2.44.1", "eslint-plugin-svelte": "^2.44.1",
"events": "^3.3.0", "events": "^3.3.0",
"glob": "^10.4.5", "glob": "^10.4.5",
"mdsvex": "^0.11.2", "mdsvex": "^0.12.6",
"postcss": "^8.4.47", "postcss": "^8.4.47",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7", "prettier-plugin-svelte": "^3.2.7",
@@ -61,11 +62,13 @@
"chartjs-plugin-zoom": "^2.0.1", "chartjs-plugin-zoom": "^2.0.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"dexie": "^4.0.8", "dexie": "^4.0.8",
"file-saver": "^2.0.5",
"gpx": "file:../gpx", "gpx": "file:../gpx",
"immer": "^10.1.1", "immer": "^10.1.1",
"lucide-static": "^0.427.0", "jszip": "^3.10.1",
"lucide-svelte": "^0.427.0", "lucide-static": "^0.460.0",
"mapbox-gl": "^3.7.0", "lucide-svelte": "^0.460.1",
"mapbox-gl": "^3.11.1",
"mapillary-js": "^4.1.2", "mapillary-js": "^4.1.2",
"mode-watcher": "^0.3.1", "mode-watcher": "^0.3.1",
"png.js": "^0.2.1", "png.js": "^0.2.1",

View File

@@ -3,4 +3,4 @@ export default {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}, autoprefixer: {},
}, },
} };

View File

@@ -1,15 +1,14 @@
<!doctype html> <!doctype html>
<html> <html>
<head>
<head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> <link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="apple-touch-icon" href="%sveltekit.assets%/apple-touch-icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
%sveltekit.head% %sveltekit.head%
</head> </head>
<body data-sveltekit-preload-data="hover"> <body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div> <div style="display: contents">%sveltekit.body%</div>
</body> </body>
</html> </html>

View File

@@ -72,7 +72,7 @@
--link: 80 190 255; --link: 80 190 255;
--ring: hsl(212.7,26.8%,83.9); --ring: hsl(212.7, 26.8%, 83.9);
} }
} }

View File

@@ -38,7 +38,8 @@ export async function handle({ event, resolve }) {
<meta name="twitter:url" content="https://gpx.studio/" /> <meta name="twitter:url" content="https://gpx.studio/" />
<meta name="twitter:site" content="@gpxstudio" /> <meta name="twitter:site" content="@gpxstudio" />
<meta name="twitter:creator" content="@gpxstudio" /> <meta name="twitter:creator" content="@gpxstudio" />
<link rel="alternate" hreflang="x-default" href="https://gpx.studio${getURLForLanguage('en', path)}" />`; <link rel="alternate" hreflang="x-default" href="https://gpx.studio${getURLForLanguage('en', path)}" />
<link rel="manifest" href="/${language}.manifest.webmanifest" />`;
for (let lang of Object.keys(languages)) { for (let lang of Object.keys(languages)) {
headTag += ` <link rel="alternate" hreflang="${lang}" href="https://gpx.studio${getURLForLanguage(lang, path)}" /> headTag += ` <link rel="alternate" hreflang="${lang}" href="https://gpx.studio${getURLForLanguage(lang, path)}" />
@@ -46,7 +47,8 @@ export async function handle({ event, resolve }) {
} }
const response = await resolve(event, { const response = await resolve(event, {
transformPageChunk: ({ html }) => html.replace('<html>', htmlTag).replace('<head>', headTag), transformPageChunk: ({ html }) =>
html.replace('<html>', htmlTag).replace('<head>', headTag),
}); });
return response; return response;

View File

@@ -1,28 +1,28 @@
export const surfaceColors: { [key: string]: string } = { export const surfaceColors: { [key: string]: string } = {
"missing": "#d1d1d1", missing: '#d1d1d1',
"paved": "#8c8c8c", paved: '#8c8c8c',
"unpaved": "#6b443a", unpaved: '#6b443a',
"asphalt": "#8c8c8c", asphalt: '#8c8c8c',
"concrete": "#8c8c8c", concrete: '#8c8c8c',
"cobblestone": "#ffd991", cobblestone: '#ffd991',
"paving_stones": "#8c8c8c", paving_stones: '#8c8c8c',
"sett": "#ffd991", sett: '#ffd991',
"metal": "#8c8c8c", metal: '#8c8c8c',
"wood": "#6b443a", wood: '#6b443a',
"compacted": "#ffffa8", compacted: '#ffffa8',
"fine_gravel": "#ffffa8", fine_gravel: '#ffffa8',
"gravel": "#ffffa8", gravel: '#ffffa8',
"pebblestone": "#ffffa8", pebblestone: '#ffffa8',
"rock": "#ffd991", rock: '#ffd991',
"dirt": "#ffffa8", dirt: '#ffffa8',
"ground": "#6b443a", ground: '#6b443a',
"earth": "#6b443a", earth: '#6b443a',
"mud": "#6b443a", mud: '#6b443a',
"sand": "#ffffc4", sand: '#ffffc4',
"grass": "#61b55c", grass: '#61b55c',
"grass_paver": "#61b55c", grass_paver: '#61b55c',
"clay": "#6b443a", clay: '#6b443a',
"stone": "#ffd991", stone: '#ffd991',
}; };
export function getSurfaceColor(surface: string): string { export function getSurfaceColor(surface: string): string {
@@ -30,66 +30,72 @@ export function getSurfaceColor(surface: string): string {
} }
export const highwayColors: { [key: string]: string } = { export const highwayColors: { [key: string]: string } = {
"missing": "#d1d1d1", missing: '#d1d1d1',
"motorway": "#ff4d33", motorway: '#ff4d33',
"motorway_link": "#ff4d33", motorway_link: '#ff4d33',
"trunk": "#ff5e4d", trunk: '#ff5e4d',
"trunk_link": "#ff947f", trunk_link: '#ff947f',
"primary": "#ff6e5c", primary: '#ff6e5c',
"primary_link": "#ff6e5c", primary_link: '#ff6e5c',
"secondary": "#ff8d7b", secondary: '#ff8d7b',
"secondary_link": "#ff8d7b", secondary_link: '#ff8d7b',
"tertiary": "#ffd75f", tertiary: '#ffd75f',
"tertiary_link": "#ffd75f", tertiary_link: '#ffd75f',
"unclassified": "#f1f2a5", unclassified: '#f1f2a5',
"road": "#f1f2a5", road: '#f1f2a5',
"residential": "#73b2ff", residential: '#73b2ff',
"living_street": "#73b2ff", living_street: '#73b2ff',
"service": "#9c9cd9", service: '#9c9cd9',
"track": "#a8e381", track: '#a8e381',
"footway": "#a8e381", footway: '#a8e381',
"path": "#a8e381", path: '#a8e381',
"pedestrian": "#a8e381", pedestrian: '#a8e381',
"cycleway": "#9de2ff", cycleway: '#9de2ff',
"construction": "#e09a4a", construction: '#e09a4a',
"bridleway": "#946f43", bridleway: '#946f43',
"raceway": "#ff0000", raceway: '#ff0000',
"rest_area": "#9c9cd9", rest_area: '#9c9cd9',
"services": "#9c9cd9", services: '#9c9cd9',
"corridor": "#474747", corridor: '#474747',
"elevator": "#474747", elevator: '#474747',
"steps": "#474747", steps: '#474747',
"bus_stop": "#8545a3", bus_stop: '#8545a3',
"busway": "#8545a3", busway: '#8545a3',
"via_ferrata": "#474747" via_ferrata: '#474747',
}; };
export const sacScaleColors: { [key: string]: string } = { export const sacScaleColors: { [key: string]: string } = {
"hiking": "#007700", hiking: '#007700',
"mountain_hiking": "#1843ad", mountain_hiking: '#1843ad',
"demanding_mountain_hiking": "#ffff00", demanding_mountain_hiking: '#ffff00',
"alpine_hiking": "#ff9233", alpine_hiking: '#ff9233',
"demanding_alpine_hiking": "#ff0000", demanding_alpine_hiking: '#ff0000',
"difficult_alpine_hiking": "#000000", difficult_alpine_hiking: '#000000',
}; };
export const mtbScaleColors: { [key: string]: string } = { export const mtbScaleColors: { [key: string]: string } = {
"0-": "#007700", '0-': '#007700',
"0": "#007700", '0': '#007700',
"0+": "#007700", '0+': '#007700',
"1-": "#1843ad", '1-': '#1843ad',
"1": "#1843ad", '1': '#1843ad',
"1+": "#1843ad", '1+': '#1843ad',
"2-": "#ffff00", '2-': '#ffff00',
"2": "#ffff00", '2': '#ffff00',
"2+": "#ffff00", '2+': '#ffff00',
"3": "#ff0000", '3': '#ff0000',
"4": "#00ff00", '4': '#00ff00',
"5": "#000000", '5': '#000000',
"6": "#b105eb", '6': '#b105eb',
}; };
function createPattern(backgroundColor: string, sacScaleColor: string | undefined, mtbScaleColor: string | undefined, size: number = 16, lineWidth: number = 4) { function createPattern(
backgroundColor: string,
sacScaleColor: string | undefined,
mtbScaleColor: string | undefined,
size: number = 16,
lineWidth: number = 4
) {
let canvas = document.createElement('canvas'); let canvas = document.createElement('canvas');
canvas.width = size; canvas.width = size;
canvas.height = size; canvas.height = size;
@@ -104,11 +110,11 @@ function createPattern(backgroundColor: string, sacScaleColor: string | undefine
if (sacScaleColor) { if (sacScaleColor) {
ctx.strokeStyle = sacScaleColor; ctx.strokeStyle = sacScaleColor;
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(halfSize - halfLineWidth, - halfLineWidth); ctx.moveTo(halfSize - halfLineWidth, -halfLineWidth);
ctx.lineTo(size + halfLineWidth, halfSize + halfLineWidth); ctx.lineTo(size + halfLineWidth, halfSize + halfLineWidth);
ctx.stroke(); ctx.stroke();
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(- halfLineWidth, halfSize - halfLineWidth); ctx.moveTo(-halfLineWidth, halfSize - halfLineWidth);
ctx.lineTo(halfSize + halfLineWidth, size + halfLineWidth); ctx.lineTo(halfSize + halfLineWidth, size + halfLineWidth);
ctx.stroke(); ctx.stroke();
} }
@@ -119,8 +125,8 @@ function createPattern(backgroundColor: string, sacScaleColor: string | undefine
ctx.lineTo(size + halfLineWidth, halfSize - halfLineWidth); ctx.lineTo(size + halfLineWidth, halfSize - halfLineWidth);
ctx.stroke(); ctx.stroke();
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(- halfLineWidth, halfSize + halfLineWidth); ctx.moveTo(-halfLineWidth, halfSize + halfLineWidth);
ctx.lineTo(halfSize + halfLineWidth, - halfLineWidth); ctx.lineTo(halfSize + halfLineWidth, -halfLineWidth);
ctx.stroke(); ctx.stroke();
} }
} }
@@ -128,12 +134,16 @@ function createPattern(backgroundColor: string, sacScaleColor: string | undefine
} }
const patterns: Record<string, string | CanvasPattern> = {}; const patterns: Record<string, string | CanvasPattern> = {};
export function getHighwayColor(highway: string, sacScale: string | undefined, mtbScale: string | undefined) { export function getHighwayColor(
highway: string,
sacScale: string | undefined,
mtbScale: string | undefined
) {
let backgroundColor = highwayColors[highway] ? highwayColors[highway] : highwayColors.missing; let backgroundColor = highwayColors[highway] ? highwayColors[highway] : highwayColors.missing;
let sacScaleColor = sacScale ? sacScaleColors[sacScale] : undefined; let sacScaleColor = sacScale ? sacScaleColors[sacScale] : undefined;
let mtbScaleColor = mtbScale ? mtbScaleColors[mtbScale] : undefined; let mtbScaleColor = mtbScale ? mtbScaleColors[mtbScale] : undefined;
if (sacScale || mtbScale) { if (sacScale || mtbScale) {
let patternId = `${backgroundColor}-${[sacScale, mtbScale].filter(x => x).join('-')}`; let patternId = `${backgroundColor}-${[sacScale, mtbScale].filter((x) => x).join('-')}`;
if (!patterns[patternId]) { if (!patterns[patternId]) {
patterns[patternId] = createPattern(backgroundColor, sacScaleColor, mtbScaleColor); patterns[patternId] = createPattern(backgroundColor, sacScaleColor, mtbScaleColor);
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,67 @@
import { Landmark, Icon, Shell, Bike, Building, Tent, Car, Wrench, ShoppingBasket, Droplet, DoorOpen, Trees, Fuel, Home, Info, TreeDeciduous, CircleParking, Cross, Utensils, Construction, BrickWall, ShowerHead, Mountain, Phone, TrainFront, Bed, Binoculars, TriangleAlert, Anchor } from "lucide-svelte"; import {
import { Landmark as LandmarkSvg, Shell as ShellSvg, Bike as BikeSvg, Building as BuildingSvg, Tent as TentSvg, Car as CarSvg, Wrench as WrenchSvg, ShoppingBasket as ShoppingBasketSvg, Droplet as DropletSvg, DoorOpen as DoorOpenSvg, Trees as TreesSvg, Fuel as FuelSvg, Home as HomeSvg, Info as InfoSvg, TreeDeciduous as TreeDeciduousSvg, CircleParking as CircleParkingSvg, Cross as CrossSvg, Utensils as UtensilsSvg, Construction as ConstructionSvg, BrickWall as BrickWallSvg, ShowerHead as ShowerHeadSvg, Mountain as MountainSvg, Phone as PhoneSvg, TrainFront as TrainFrontSvg, Bed as BedSvg, Binoculars as BinocularsSvg, TriangleAlert as TriangleAlertSvg, Anchor as AnchorSvg } from "lucide-static"; Landmark,
import type { ComponentType } from "svelte"; Icon,
Shell,
Bike,
Building,
Tent,
Car,
Wrench,
ShoppingBasket,
Droplet,
DoorOpen,
Trees,
Fuel,
Home,
Info,
TreeDeciduous,
CircleParking,
Cross,
Utensils,
Construction,
BrickWall,
ShowerHead,
Mountain,
Phone,
TrainFront,
Bed,
Binoculars,
TriangleAlert,
Anchor,
Toilet,
} from 'lucide-svelte';
import {
Landmark as LandmarkSvg,
Shell as ShellSvg,
Bike as BikeSvg,
Building as BuildingSvg,
Tent as TentSvg,
Car as CarSvg,
Wrench as WrenchSvg,
ShoppingBasket as ShoppingBasketSvg,
Droplet as DropletSvg,
DoorOpen as DoorOpenSvg,
Trees as TreesSvg,
Fuel as FuelSvg,
Home as HomeSvg,
Info as InfoSvg,
TreeDeciduous as TreeDeciduousSvg,
CircleParking as CircleParkingSvg,
Cross as CrossSvg,
Utensils as UtensilsSvg,
Construction as ConstructionSvg,
BrickWall as BrickWallSvg,
ShowerHead as ShowerHeadSvg,
Mountain as MountainSvg,
Phone as PhoneSvg,
TrainFront as TrainFrontSvg,
Bed as BedSvg,
Binoculars as BinocularsSvg,
TriangleAlert as TriangleAlertSvg,
Anchor as AnchorSvg,
Toilet as ToiletSvg,
} from 'lucide-static';
import type { ComponentType } from 'svelte';
export type Symbol = { export type Symbol = {
value: string; value: string;
@@ -20,16 +81,28 @@ export const symbols: { [key: string]: Symbol } = {
campground: { value: 'Campground', icon: Tent, iconSvg: TentSvg }, campground: { value: 'Campground', icon: Tent, iconSvg: TentSvg },
car: { value: 'Car', icon: Car, iconSvg: CarSvg }, car: { value: 'Car', icon: Car, iconSvg: CarSvg },
car_repair: { value: 'Car Repair', icon: Wrench, iconSvg: WrenchSvg }, car_repair: { value: 'Car Repair', icon: Wrench, iconSvg: WrenchSvg },
convenience_store: { value: 'Convenience Store', icon: ShoppingBasket, iconSvg: ShoppingBasketSvg }, convenience_store: {
value: 'Convenience Store',
icon: ShoppingBasket,
iconSvg: ShoppingBasketSvg,
},
crossing: { value: 'Crossing' }, crossing: { value: 'Crossing' },
department_store: { value: 'Department Store', icon: ShoppingBasket, iconSvg: ShoppingBasketSvg }, department_store: {
value: 'Department Store',
icon: ShoppingBasket,
iconSvg: ShoppingBasketSvg,
},
drinking_water: { value: 'Drinking Water', icon: Droplet, iconSvg: DropletSvg }, drinking_water: { value: 'Drinking Water', icon: Droplet, iconSvg: DropletSvg },
exit: { value: 'Exit', icon: DoorOpen, iconSvg: DoorOpenSvg }, exit: { value: 'Exit', icon: DoorOpen, iconSvg: DoorOpenSvg },
lodge: { value: 'Lodge', icon: Home, iconSvg: HomeSvg }, lodge: { value: 'Lodge', icon: Home, iconSvg: HomeSvg },
lodging: { value: 'Lodging', icon: Bed, iconSvg: BedSvg }, lodging: { value: 'Lodging', icon: Bed, iconSvg: BedSvg },
forest: { value: 'Forest', icon: Trees, iconSvg: TreesSvg }, forest: { value: 'Forest', icon: Trees, iconSvg: TreesSvg },
gas_station: { value: 'Gas Station', icon: Fuel, iconSvg: FuelSvg }, gas_station: { value: 'Gas Station', icon: Fuel, iconSvg: FuelSvg },
ground_transportation: { value: 'Ground Transportation', icon: TrainFront, iconSvg: TrainFrontSvg }, ground_transportation: {
value: 'Ground Transportation',
icon: TrainFront,
iconSvg: TrainFrontSvg,
},
hotel: { value: 'Hotel', icon: Bed, iconSvg: BedSvg }, hotel: { value: 'Hotel', icon: Bed, iconSvg: BedSvg },
house: { value: 'House', icon: Home, iconSvg: HomeSvg }, house: { value: 'House', icon: Home, iconSvg: HomeSvg },
information: { value: 'Information', icon: Info, iconSvg: InfoSvg }, information: { value: 'Information', icon: Info, iconSvg: InfoSvg },
@@ -39,7 +112,7 @@ export const symbols: { [key: string]: Symbol } = {
picnic_area: { value: 'Picnic Area', icon: Utensils, iconSvg: UtensilsSvg }, picnic_area: { value: 'Picnic Area', icon: Utensils, iconSvg: UtensilsSvg },
restaurant: { value: 'Restaurant', icon: Utensils, iconSvg: UtensilsSvg }, restaurant: { value: 'Restaurant', icon: Utensils, iconSvg: UtensilsSvg },
restricted_area: { value: 'Restricted Area', icon: Construction, iconSvg: ConstructionSvg }, restricted_area: { value: 'Restricted Area', icon: Construction, iconSvg: ConstructionSvg },
restroom: { value: 'Restroom' }, restroom: { value: 'Restroom', icon: Toilet, iconSvg: ToiletSvg },
road: { value: 'Road', icon: BrickWall, iconSvg: BrickWallSvg }, road: { value: 'Road', icon: BrickWall, iconSvg: BrickWallSvg },
scenic_area: { value: 'Scenic Area', icon: Binoculars, iconSvg: BinocularsSvg }, scenic_area: { value: 'Scenic Area', icon: Binoculars, iconSvg: BinocularsSvg },
shelter: { value: 'Shelter', icon: Tent, iconSvg: TentSvg }, shelter: { value: 'Shelter', icon: Tent, iconSvg: TentSvg },
@@ -55,6 +128,6 @@ export function getSymbolKey(value: string | undefined): string | undefined {
if (value === undefined) { if (value === undefined) {
return undefined; return undefined;
} else { } else {
return Object.keys(symbols).find(key => symbols[key].value === value); return Object.keys(symbols).find((key) => symbols[key].value === value);
} }
} }

View File

@@ -13,14 +13,14 @@
indexName: 'gpx', indexName: 'gpx',
container: '#docsearch', container: '#docsearch',
searchParameters: { searchParameters: {
facetFilters: ['lang:' + ($locale ?? 'en')] facetFilters: ['lang:' + ($locale ?? 'en')],
}, },
placeholder: $_('docs.search.search'), placeholder: $_('docs.search.search'),
disableUserPersonalization: true, disableUserPersonalization: true,
translations: { translations: {
button: { button: {
buttonText: $_('docs.search.search'), buttonText: $_('docs.search.search'),
buttonAriaLabel: $_('docs.search.search') buttonAriaLabel: $_('docs.search.search'),
}, },
modal: { modal: {
searchBox: { searchBox: {
@@ -28,19 +28,19 @@
resetButtonAriaLabel: $_('docs.search.clear'), resetButtonAriaLabel: $_('docs.search.clear'),
cancelButtonText: $_('docs.search.cancel'), cancelButtonText: $_('docs.search.cancel'),
cancelButtonAriaLabel: $_('docs.search.cancel'), cancelButtonAriaLabel: $_('docs.search.cancel'),
searchInputLabel: $_('docs.search.search') searchInputLabel: $_('docs.search.search'),
}, },
footer: { footer: {
selectText: $_('docs.search.to_select'), selectText: $_('docs.search.to_select'),
navigateText: $_('docs.search.to_navigate'), navigateText: $_('docs.search.to_navigate'),
closeText: $_('docs.search.to_close') closeText: $_('docs.search.to_close'),
}, },
noResultsScreen: { noResultsScreen: {
noResultsText: $_('docs.search.no_results'), noResultsText: $_('docs.search.no_results'),
suggestedQueryText: $_('docs.search.no_results_suggestion') suggestedQueryText: $_('docs.search.no_results_suggestion'),
} },
} },
} },
}); });
} }

View File

@@ -0,0 +1,18 @@
<script lang="ts">
import { map } from '$lib/stores';
import { trackpointPopup } from '$lib/components/gpx-layer/GPXLayerPopup';
import { TrackPoint } from 'gpx';
$: if ($map) {
$map.on('contextmenu', (e) => {
trackpointPopup?.setItem({
item: new TrackPoint({
attributes: {
lat: e.lngLat.lat,
lon: e.lngLat.lng,
},
}),
});
});
}
</script>

View File

@@ -17,7 +17,7 @@
Circle, Circle,
Check, Check,
ChartNoAxesColumn, ChartNoAxesColumn,
Construction Construction,
} from 'lucide-svelte'; } from 'lucide-svelte';
import { getSlopeColor, getSurfaceColor, getHighwayColor } from '$lib/assets/colors'; import { getSlopeColor, getSurfaceColor, getHighwayColor } from '$lib/assets/colors';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
@@ -33,7 +33,7 @@
getHeartRateWithUnits, getHeartRateWithUnits,
getPowerWithUnits, getPowerWithUnits,
getTemperatureWithUnits, getTemperatureWithUnits,
getVelocityWithUnits getVelocityWithUnits,
} from '$lib/units'; } from '$lib/units';
import type { Writable } from 'svelte/store'; import type { Writable } from 'svelte/store';
import type { GPXStatistics } from 'gpx'; import type { GPXStatistics } from 'gpx';
@@ -72,37 +72,37 @@
return `${value.toFixed(1).replace(/\.0+$/, '')} ${getDistanceUnits()}`; return `${value.toFixed(1).replace(/\.0+$/, '')} ${getDistanceUnits()}`;
}, },
align: 'inner', align: 'inner',
maxRotation: 0 maxRotation: 0,
} },
}, },
y: { y: {
type: 'linear', type: 'linear',
ticks: { ticks: {
callback: function (value: number) { callback: function (value: number) {
return getElevationWithUnits(value, false); return getElevationWithUnits(value, false);
} },
} },
} },
}, },
datasets: { datasets: {
line: { line: {
pointRadius: 0, pointRadius: 0,
tension: 0.4, tension: 0.4,
borderWidth: 2, borderWidth: 2,
cubicInterpolationMode: 'monotone' cubicInterpolationMode: 'monotone',
} },
}, },
interaction: { interaction: {
mode: 'nearest', mode: 'nearest',
axis: 'x', axis: 'x',
intersect: false intersect: false,
}, },
plugins: { plugins: {
legend: { legend: {
display: false display: false,
}, },
decimation: { decimation: {
enabled: true enabled: true,
}, },
tooltip: { tooltip: {
enabled: () => !dragging && !panning, enabled: () => !dragging && !panning,
@@ -141,16 +141,20 @@
let slope = { let slope = {
at: point.slope.at.toFixed(1), at: point.slope.at.toFixed(1),
segment: point.slope.segment.toFixed(1), segment: point.slope.segment.toFixed(1),
length: getDistanceWithUnits(point.slope.length) length: getDistanceWithUnits(point.slope.length),
}; };
let surface = point.extensions.surface ? point.extensions.surface : 'unknown'; let surface = point.extensions.surface
let highway = point.extensions.highway ? point.extensions.highway : 'unknown'; ? point.extensions.surface
: 'unknown';
let highway = point.extensions.highway
? point.extensions.highway
: 'unknown';
let sacScale = point.extensions.sac_scale; let sacScale = point.extensions.sac_scale;
let mtbScale = point.extensions.mtb_scale; let mtbScale = point.extensions.mtb_scale;
let labels = [ let labels = [
` ${$_('quantities.distance')}: ${getDistanceWithUnits(point.x, false)}`, ` ${$_('quantities.distance')}: ${getDistanceWithUnits(point.x, false)}`,
` ${$_('quantities.slope')}: ${slope.at} %${elevationFill === 'slope' ? ` (${slope.length} @${slope.segment} %)` : ''}` ` ${$_('quantities.slope')}: ${slope.at} %${elevationFill === 'slope' ? ` (${slope.length} @${slope.segment} %)` : ''}`,
]; ];
if (elevationFill === 'surface') { if (elevationFill === 'surface') {
@@ -162,7 +166,9 @@
if (elevationFill === 'highway') { if (elevationFill === 'highway') {
labels.push( labels.push(
` ${$_('quantities.highway')}: ${$_(`toolbar.routing.highway.${highway}`)}${ ` ${$_('quantities.highway')}: ${$_(`toolbar.routing.highway.${highway}`)}${
sacScale ? ` (${$_(`toolbar.routing.sac_scale.${sacScale}`)})` : '' sacScale
? ` (${$_(`toolbar.routing.sac_scale.${sacScale}`)})`
: ''
}` }`
); );
if (mtbScale) { if (mtbScale) {
@@ -175,8 +181,8 @@
} }
return labels; return labels;
} },
} },
}, },
zoom: { zoom: {
pan: { pan: {
@@ -190,18 +196,19 @@
}, },
onPanComplete: function () { onPanComplete: function () {
panning = false; panning = false;
} },
}, },
zoom: { zoom: {
wheel: { wheel: {
enabled: true enabled: true,
}, },
mode: 'x', mode: 'x',
onZoomStart: function ({ chart, event }: { chart: Chart; event: any }) { onZoomStart: function ({ chart, event }: { chart: Chart; event: any }) {
if ( if (
event.deltaY < 0 && event.deltaY < 0 &&
Math.abs( Math.abs(
chart.getInitialScaleBounds().x.max / chart.options.plugins.zoom.limits.x.minRange - chart.getInitialScaleBounds().x.max /
chart.options.plugins.zoom.limits.x.minRange -
chart.getZoomLevel() chart.getZoomLevel()
) < 0.01 ) < 0.01
) { ) {
@@ -210,21 +217,21 @@
} }
$slicedGPXStatistics = undefined; $slicedGPXStatistics = undefined;
} },
}, },
limits: { limits: {
x: { x: {
min: 'original', min: 'original',
max: 'original', max: 'original',
minRange: 1 minRange: 1,
} },
} },
} },
}, },
stacked: false, stacked: false,
onResize: function () { onResize: function () {
updateOverlay(); updateOverlay();
} },
}; };
let datasets: string[] = ['speed', 'hr', 'cad', 'atemp', 'power']; let datasets: string[] = ['speed', 'hr', 'cad', 'atemp', 'power'];
@@ -233,10 +240,10 @@
type: 'linear', type: 'linear',
position: 'right', position: 'right',
grid: { grid: {
display: false display: false,
}, },
reverse: () => id === 'speed' && $velocityUnits === 'pace', reverse: () => id === 'speed' && $velocityUnits === 'pace',
display: false display: false,
}; };
}); });
@@ -246,7 +253,7 @@
chart = new Chart(canvas, { chart = new Chart(canvas, {
type: 'line', type: 'line',
data: { data: {
datasets: [] datasets: [],
}, },
options, options,
plugins: [ plugins: [
@@ -259,16 +266,16 @@
marker.remove(); marker.remove();
} }
} }
} },
} },
] ],
}); });
// Map marker to show on hover // Map marker to show on hover
let element = document.createElement('div'); let element = document.createElement('div');
element.className = 'h-4 w-4 rounded-full bg-cyan-500 border-2 border-white'; element.className = 'h-4 w-4 rounded-full bg-cyan-500 border-2 border-white';
marker = new mapboxgl.Marker({ marker = new mapboxgl.Marker({
element element,
}); });
let startIndex = 0; let startIndex = 0;
@@ -278,7 +285,7 @@
evt, evt,
'x', 'x',
{ {
intersect: false intersect: false,
}, },
true true
); );
@@ -321,9 +328,12 @@
startIndex = endIndex; startIndex = endIndex;
} else if (startIndex !== endIndex) { } else if (startIndex !== endIndex) {
$slicedGPXStatistics = [ $slicedGPXStatistics = [
$gpxStatistics.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex)), $gpxStatistics.slice(
Math.min(startIndex, endIndex), Math.min(startIndex, endIndex),
Math.max(startIndex, endIndex) Math.max(startIndex, endIndex)
),
Math.min(startIndex, endIndex),
Math.max(startIndex, endIndex),
]; ];
} }
} }
@@ -357,76 +367,76 @@
slope: { slope: {
at: data.local.slope.at[index], at: data.local.slope.at[index],
segment: data.local.slope.segment[index], segment: data.local.slope.segment[index],
length: data.local.slope.length[index] length: data.local.slope.length[index],
}, },
extensions: point.getExtensions(), extensions: point.getExtensions(),
coordinates: point.getCoordinates(), coordinates: point.getCoordinates(),
index: index index: index,
}; };
}), }),
normalized: true, normalized: true,
fill: 'start', fill: 'start',
order: 1 order: 1,
}; };
chart.data.datasets[1] = { chart.data.datasets[1] = {
data: data.local.points.map((point, index) => { data: data.local.points.map((point, index) => {
return { return {
x: getConvertedDistance(data.local.distance.total[index]), x: getConvertedDistance(data.local.distance.total[index]),
y: getConvertedVelocity(data.local.speed[index]), y: getConvertedVelocity(data.local.speed[index]),
index: index index: index,
}; };
}), }),
normalized: true, normalized: true,
yAxisID: 'yspeed', yAxisID: 'yspeed',
hidden: true hidden: true,
}; };
chart.data.datasets[2] = { chart.data.datasets[2] = {
data: data.local.points.map((point, index) => { data: data.local.points.map((point, index) => {
return { return {
x: getConvertedDistance(data.local.distance.total[index]), x: getConvertedDistance(data.local.distance.total[index]),
y: point.getHeartRate(), y: point.getHeartRate(),
index: index index: index,
}; };
}), }),
normalized: true, normalized: true,
yAxisID: 'yhr', yAxisID: 'yhr',
hidden: true hidden: true,
}; };
chart.data.datasets[3] = { chart.data.datasets[3] = {
data: data.local.points.map((point, index) => { data: data.local.points.map((point, index) => {
return { return {
x: getConvertedDistance(data.local.distance.total[index]), x: getConvertedDistance(data.local.distance.total[index]),
y: point.getCadence(), y: point.getCadence(),
index: index index: index,
}; };
}), }),
normalized: true, normalized: true,
yAxisID: 'ycad', yAxisID: 'ycad',
hidden: true hidden: true,
}; };
chart.data.datasets[4] = { chart.data.datasets[4] = {
data: data.local.points.map((point, index) => { data: data.local.points.map((point, index) => {
return { return {
x: getConvertedDistance(data.local.distance.total[index]), x: getConvertedDistance(data.local.distance.total[index]),
y: getConvertedTemperature(point.getTemperature()), y: getConvertedTemperature(point.getTemperature()),
index: index index: index,
}; };
}), }),
normalized: true, normalized: true,
yAxisID: 'yatemp', yAxisID: 'yatemp',
hidden: true hidden: true,
}; };
chart.data.datasets[5] = { chart.data.datasets[5] = {
data: data.local.points.map((point, index) => { data: data.local.points.map((point, index) => {
return { return {
x: getConvertedDistance(data.local.distance.total[index]), x: getConvertedDistance(data.local.distance.total[index]),
y: point.getPower(), y: point.getPower(),
index: index index: index,
}; };
}), }),
normalized: true, normalized: true,
yAxisID: 'ypower', yAxisID: 'ypower',
hidden: true hidden: true,
}; };
chart.options.scales.x['min'] = 0; chart.options.scales.x['min'] = 0;
chart.options.scales.x['max'] = getConvertedDistance(data.global.distance.total); chart.options.scales.x['max'] = getConvertedDistance(data.global.distance.total);
@@ -453,15 +463,15 @@
$: if (chart) { $: if (chart) {
if (elevationFill === 'slope') { if (elevationFill === 'slope') {
chart.data.datasets[0]['segment'] = { chart.data.datasets[0]['segment'] = {
backgroundColor: slopeFillCallback backgroundColor: slopeFillCallback,
}; };
} else if (elevationFill === 'surface') { } else if (elevationFill === 'surface') {
chart.data.datasets[0]['segment'] = { chart.data.datasets[0]['segment'] = {
backgroundColor: surfaceFillCallback backgroundColor: surfaceFillCallback,
}; };
} else if (elevationFill === 'highway') { } else if (elevationFill === 'highway') {
chart.data.datasets[0]['segment'] = { chart.data.datasets[0]['segment'] = {
backgroundColor: highwayFillCallback backgroundColor: highwayFillCallback,
}; };
} else { } else {
chart.data.datasets[0]['segment'] = {}; chart.data.datasets[0]['segment'] = {};
@@ -553,7 +563,11 @@
<ChartNoAxesColumn size="18" /> <ChartNoAxesColumn size="18" />
</ButtonWithTooltip> </ButtonWithTooltip>
</Popover.Trigger> </Popover.Trigger>
<Popover.Content class="w-fit p-0 flex flex-col divide-y" side="top" sideOffset={-32}> <Popover.Content
class="w-fit p-0 flex flex-col divide-y"
side="top"
sideOffset={-32}
>
<ToggleGroup.Root <ToggleGroup.Root
class="flex flex-col items-start gap-0 p-1" class="flex flex-col items-start gap-0 p-1"
type="single" type="single"
@@ -613,7 +627,9 @@
{/if} {/if}
</div> </div>
<Zap size="15" class="mr-1" /> <Zap size="15" class="mr-1" />
{$velocityUnits === 'speed' ? $_('quantities.speed') : $_('quantities.pace')} {$velocityUnits === 'speed'
? $_('quantities.speed')
: $_('quantities.pace')}
</ToggleGroup.Item> </ToggleGroup.Item>
<ToggleGroup.Item <ToggleGroup.Item
class="p-0 pr-1.5 h-6 w-full rounded flex justify-start data-[state=on]:bg-background data-[state=on]:hover:bg-accent hover:bg-accent hover:text-foreground" class="p-0 pr-1.5 h-6 w-full rounded flex justify-start data-[state=on]:bg-background data-[state=on]:hover:bg-accent hover:bg-accent hover:text-foreground"

View File

@@ -10,7 +10,7 @@
exportSelectedFiles, exportSelectedFiles,
ExportState, ExportState,
exportState, exportState,
gpxStatistics gpxStatistics,
} from '$lib/stores'; } from '$lib/stores';
import { fileObservers } from '$lib/db'; import { fileObservers } from '$lib/db';
import { import {
@@ -20,7 +20,7 @@
HeartPulse, HeartPulse,
Orbit, Orbit,
Thermometer, Thermometer,
SquareActivity SquareActivity,
} from 'lucide-svelte'; } from 'lucide-svelte';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import { selection } from './file-list/Selection'; import { selection } from './file-list/Selection';
@@ -35,7 +35,7 @@
cad: true, cad: true,
atemp: true, atemp: true,
power: true, power: true,
extensions: true extensions: true,
}; };
let hide: Record<string, boolean> = { let hide: Record<string, boolean> = {
time: false, time: false,
@@ -43,7 +43,7 @@
cad: false, cad: false,
atemp: false, atemp: false,
power: false, power: false,
extensions: false extensions: false,
}; };
$: if ($exportState !== ExportState.NONE) { $: if ($exportState !== ExportState.NONE) {
@@ -121,7 +121,9 @@
</Button> </Button>
</div> </div>
<div <div
class="w-full max-w-xl flex flex-col items-center gap-2 {Object.values(hide).some((v) => !v) class="w-full max-w-xl flex flex-col items-center gap-2 {Object.values(hide).some(
(v) => !v
)
? '' ? ''
: 'hidden'}" : 'hidden'}"
> >
@@ -144,7 +146,9 @@
{$_('quantities.time')} {$_('quantities.time')}
</Label> </Label>
</div> </div>
<div class="flex flex-row items-center gap-1.5 {hide.extensions ? 'hidden' : ''}"> <div
class="flex flex-row items-center gap-1.5 {hide.extensions ? 'hidden' : ''}"
>
<Checkbox id="export-extensions" bind:checked={exportOptions.extensions} /> <Checkbox id="export-extensions" bind:checked={exportOptions.extensions} />
<Label for="export-extensions" class="flex flex-row items-center gap-1"> <Label for="export-extensions" class="flex flex-row items-center gap-1">
<Earth size="16" /> <Earth size="16" />

View File

@@ -53,13 +53,17 @@
{#if panelSize > 120 || orientation === 'horizontal'} {#if panelSize > 120 || orientation === 'horizontal'}
<Tooltip <Tooltip
class={orientation === 'horizontal' ? 'hidden xs:block' : ''} class={orientation === 'horizontal' ? 'hidden xs:block' : ''}
label="{$velocityUnits === 'speed' ? $_('quantities.speed') : $_('quantities.pace')} ({$_( label="{$velocityUnits === 'speed'
'quantities.moving' ? $_('quantities.speed')
)} / {$_('quantities.total')})" : $_('quantities.pace')} ({$_('quantities.moving')} / {$_('quantities.total')})"
> >
<span class="flex flex-row items-center"> <span class="flex flex-row items-center">
<Zap size="16" class="mr-1" /> <Zap size="16" class="mr-1" />
<WithUnits value={statistics.global.speed.moving} type="speed" showUnits={false} /> <WithUnits
value={statistics.global.speed.moving}
type="speed"
showUnits={false}
/>
<span class="mx-1">/</span> <span class="mx-1">/</span>
<WithUnits value={statistics.global.speed.total} type="speed" /> <WithUnits value={statistics.global.speed.total} type="speed" />
</span> </span>
@@ -68,7 +72,9 @@
{#if panelSize > 160 || orientation === 'horizontal'} {#if panelSize > 160 || orientation === 'horizontal'}
<Tooltip <Tooltip
class={orientation === 'horizontal' ? 'hidden md:block' : ''} class={orientation === 'horizontal' ? 'hidden md:block' : ''}
label="{$_('quantities.time')} ({$_('quantities.moving')} / {$_('quantities.total')})" label="{$_('quantities.time')} ({$_('quantities.moving')} / {$_(
'quantities.total'
)})"
> >
<span class="flex flex-row items-center"> <span class="flex flex-row items-center">
<Timer size="16" class="mr-1" /> <Timer size="16" class="mr-1" />

View File

@@ -8,13 +8,13 @@
let selected = { let selected = {
value: '', value: '',
label: '' label: '',
}; };
$: if ($locale) { $: if ($locale) {
selected = { selected = {
value: $locale, value: $locale,
label: languages[$locale] label: languages[$locale],
}; };
} }
</script> </script>

View File

@@ -22,16 +22,17 @@
mapboxgl.accessToken = accessToken; mapboxgl.accessToken = accessToken;
let webgl2Supported = true; let webgl2Supported = true;
let embeddedApp = false;
let fitBoundsOptions: mapboxgl.FitBoundsOptions = { let fitBoundsOptions: mapboxgl.FitBoundsOptions = {
maxZoom: 15, maxZoom: 15,
linear: true, linear: true,
easing: () => 1 easing: () => 1,
}; };
const { distanceUnits, elevationProfile, verticalFileView, bottomPanelSize, rightPanelSize } = const { distanceUnits, elevationProfile, treeFileView, bottomPanelSize, rightPanelSize } =
settings; settings;
let scaleControl = new mapboxgl.ScaleControl({ let scaleControl = new mapboxgl.ScaleControl({
unit: $distanceUnits unit: $distanceUnits,
}); });
onMount(() => { onMount(() => {
@@ -40,6 +41,10 @@
webgl2Supported = false; webgl2Supported = false;
return; return;
} }
if (window.top !== window.self && !$page.route.id?.includes('embed')) {
embeddedApp = true;
return;
}
let language = $page.params.language; let language = $page.params.language;
if (language === 'zh') { if (language === 'zh') {
@@ -50,20 +55,6 @@
language = 'en'; language = 'en';
} }
const loadJson = mapboxgl.Style.prototype._load;
mapboxgl.Style.prototype._load = function (json, validate) {
if (
json['sources'] &&
json['sources']['mapbox-satellite'] &&
json['sources']['mapbox-satellite']['data'] &&
json['sources']['mapbox-satellite']['data']['data']
) {
// Temporary fix for https://github.com/gpxstudio/gpx.studio/issues/129
delete json['sources']['mapbox-satellite']['data']['data'];
}
loadJson.call(this, json, validate);
};
let newMap = new mapboxgl.Map({ let newMap = new mapboxgl.Map({
container: 'map', container: 'map',
style: { style: {
@@ -79,12 +70,12 @@
sources: {}, sources: {},
layers: [], layers: [],
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf', glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
sprite: `https://api.mapbox.com/styles/v1/mapbox/outdoors-v12/sprite?access_token=${PUBLIC_MAPBOX_TOKEN}` sprite: `https://api.mapbox.com/styles/v1/mapbox/outdoors-v12/sprite?access_token=${PUBLIC_MAPBOX_TOKEN}`,
} },
}, },
{ {
id: 'basemap', id: 'basemap',
url: '' url: '',
}, },
{ {
id: 'overlays', id: 'overlays',
@@ -92,17 +83,18 @@
data: { data: {
version: 8, version: 8,
sources: {}, sources: {},
layers: [] layers: [],
}
}
]
}, },
},
],
},
projection: 'globe',
zoom: 0, zoom: 0,
hash: hash, hash: hash,
language, language,
attributionControl: false, attributionControl: false,
logoPosition: 'bottom-right', logoPosition: 'bottom-right',
boxZoom: false boxZoom: false,
}); });
newMap.on('load', () => { newMap.on('load', () => {
$map = newMap; // only set the store after the map has loaded $map = newMap; // only set the store after the map has loaded
@@ -112,13 +104,13 @@
newMap.addControl( newMap.addControl(
new mapboxgl.AttributionControl({ new mapboxgl.AttributionControl({
compact: true compact: true,
}) })
); );
newMap.addControl( newMap.addControl(
new mapboxgl.NavigationControl({ new mapboxgl.NavigationControl({
visualizePitch: true visualizePitch: true,
}) })
); );
@@ -142,12 +134,12 @@
type: 'Feature', type: 'Feature',
geometry: { geometry: {
type: 'Point', type: 'Point',
coordinates: [result.lon, result.lat] coordinates: [result.lon, result.lat],
}, },
place_name: result.display_name place_name: result.display_name,
}; };
}); });
}) }),
}); });
let onKeyDown = geocoder._onKeyDown; let onKeyDown = geocoder._onKeyDown;
geocoder._onKeyDown = (e: KeyboardEvent) => { geocoder._onKeyDown = (e: KeyboardEvent) => {
@@ -165,11 +157,11 @@
newMap.addControl( newMap.addControl(
new mapboxgl.GeolocateControl({ new mapboxgl.GeolocateControl({
positionOptions: { positionOptions: {
enableHighAccuracy: true enableHighAccuracy: true,
}, },
fitBoundsOptions, fitBoundsOptions,
trackUserLocation: true, trackUserLocation: true,
showUserHeading: true showUserHeading: true,
}) })
); );
} }
@@ -181,25 +173,25 @@
type: 'raster-dem', type: 'raster-dem',
url: 'mapbox://mapbox.mapbox-terrain-dem-v1', url: 'mapbox://mapbox.mapbox-terrain-dem-v1',
tileSize: 512, tileSize: 512,
maxzoom: 14 maxzoom: 14,
}); });
if (newMap.getPitch() > 0) { if (newMap.getPitch() > 0) {
newMap.setTerrain({ newMap.setTerrain({
source: 'mapbox-dem', source: 'mapbox-dem',
exaggeration: 1 exaggeration: 1,
}); });
} }
newMap.setFog({ newMap.setFog({
color: 'rgb(186, 210, 235)', color: 'rgb(186, 210, 235)',
'high-color': 'rgb(36, 92, 223)', 'high-color': 'rgb(36, 92, 223)',
'horizon-blend': 0.1, 'horizon-blend': 0.1,
'space-color': 'rgb(156, 240, 255)' 'space-color': 'rgb(156, 240, 255)',
}); });
newMap.on('pitch', () => { newMap.on('pitch', () => {
if (newMap.getPitch() > 0) { if (newMap.getPitch() > 0) {
newMap.setTerrain({ newMap.setTerrain({
source: 'mapbox-dem', source: 'mapbox-dem',
exaggeration: 1 exaggeration: 1,
}); });
} else { } else {
newMap.setTerrain(null); newMap.setTerrain(null);
@@ -215,23 +207,30 @@
} }
}); });
$: if ( $: if ($map && (!$treeFileView || !$elevationProfile || $bottomPanelSize || $rightPanelSize)) {
$map &&
(!$verticalFileView || !$elevationProfile || $bottomPanelSize || $rightPanelSize)
) {
$map.resize(); $map.resize();
} }
</script> </script>
<div {...$$restProps}> <div {...$$restProps}>
<div id="map" class="h-full {webgl2Supported ? '' : 'hidden'}"></div> <div id="map" class="h-full {webgl2Supported && !embeddedApp ? '' : 'hidden'}"></div>
<div <div
class="flex flex-col items-center justify-center gap-3 h-full {webgl2Supported ? 'hidden' : ''}" class="flex flex-col items-center justify-center gap-3 h-full {webgl2Supported &&
!embeddedApp
? 'hidden'
: ''} {embeddedApp ? 'z-30' : ''}"
> >
{#if !webgl2Supported}
<p>{$_('webgl2_required')}</p> <p>{$_('webgl2_required')}</p>
<Button href="https://get.webgl.org/webgl2/" target="_blank"> <Button href="https://get.webgl.org/webgl2/" target="_blank">
{$_('enable_webgl2')} {$_('enable_webgl2')}
</Button> </Button>
{:else if embeddedApp}
<p>The app cannot be embedded in an iframe.</p>
<Button href="https://gpx.studio/help/integration" target="_blank">
Learn how to create a map for your website
</Button>
{/if}
</div> </div>
</div> </div>

View File

@@ -1,12 +1,13 @@
import { TrackPoint, Waypoint } from "gpx"; import { TrackPoint, Waypoint } from 'gpx';
import mapboxgl from "mapbox-gl"; import mapboxgl from 'mapbox-gl';
import { tick } from "svelte"; import { tick } from 'svelte';
import { get, writable, type Writable } from "svelte/store"; import { get, writable, type Writable } from 'svelte/store';
import MapPopupComponent from "./MapPopup.svelte"; import MapPopupComponent from './MapPopup.svelte';
export type PopupItem<T = Waypoint | TrackPoint | any> = { export type PopupItem<T = Waypoint | TrackPoint | any> = {
item: T; item: T;
fileId?: string; fileId?: string;
hide?: () => void;
}; };
export class MapPopup { export class MapPopup {
@@ -22,14 +23,15 @@ export class MapPopup {
let component = new MapPopupComponent({ let component = new MapPopupComponent({
target: document.body, target: document.body,
props: { props: {
item: this.item item: this.item,
} },
}); });
tick().then(() => this.popup.setDOMContent(component.container)); tick().then(() => this.popup.setDOMContent(component.container));
} }
setItem(item: PopupItem | null) { setItem(item: PopupItem | null) {
if (item) item.hide = () => this.hide();
this.item.set(item); this.item.set(item);
if (item === null) { if (item === null) {
this.hide(); this.hide();
@@ -73,6 +75,8 @@ export class MapPopup {
if (i === null) { if (i === null) {
return new mapboxgl.LngLat(0, 0); return new mapboxgl.LngLat(0, 0);
} }
return (i.item instanceof Waypoint || i.item instanceof TrackPoint) ? i.item.getCoordinates() : new mapboxgl.LngLat(i.item.lon, i.item.lat); return i.item instanceof Waypoint || i.item instanceof TrackPoint
? i.item.getCoordinates()
: new mapboxgl.LngLat(i.item.lon, i.item.lat);
} }
} }

View File

@@ -22,7 +22,7 @@
Sun, Sun,
Moon, Moon,
Layers, Layers,
GalleryVertical, ListTree,
Languages, Languages,
Settings, Settings,
Info, Info,
@@ -42,7 +42,7 @@
FileX, FileX,
BookOpenText, BookOpenText,
ChartArea, ChartArea,
Maximize Maximize,
} from 'lucide-svelte'; } from 'lucide-svelte';
import { import {
@@ -56,7 +56,7 @@
editStyle, editStyle,
exportState, exportState,
ExportState, ExportState,
centerMapOnSelection centerMapOnSelection,
} from '$lib/stores'; } from '$lib/stores';
import { import {
copied, copied,
@@ -64,7 +64,7 @@
cutSelection, cutSelection,
pasteSelection, pasteSelection,
selectAll, selectAll,
selection selection,
} from '$lib/components/file-list/Selection'; } from '$lib/components/file-list/Selection';
import { derived } from 'svelte/store'; import { derived } from 'svelte/store';
import { canUndo, canRedo, dbUtils, fileObservers, settings } from '$lib/db'; import { canUndo, canRedo, dbUtils, fileObservers, settings } from '$lib/db';
@@ -83,7 +83,7 @@
velocityUnits, velocityUnits,
temperatureUnits, temperatureUnits,
elevationProfile, elevationProfile,
verticalFileView, treeFileView,
currentBasemap, currentBasemap,
previousBasemap, previousBasemap,
currentOverlays, currentOverlays,
@@ -91,7 +91,7 @@
distanceMarkers, distanceMarkers,
directionMarkers, directionMarkers,
streetViewSource, streetViewSource,
routing routing,
} = settings; } = settings;
let undoDisabled = derived(canUndo, ($canUndo) => !$canUndo); let undoDisabled = derived(canUndo, ($canUndo) => !$canUndo);
@@ -128,7 +128,7 @@
<div <div
class="w-fit flex flex-row items-center justify-center p-1 bg-background rounded-b-md md:rounded-md pointer-events-auto shadow-md" class="w-fit flex flex-row items-center justify-center p-1 bg-background rounded-b-md md:rounded-md pointer-events-auto shadow-md"
> >
<a href="./" target="_blank" class="shrink-0"> <a href={getURLForLanguage($locale, '/')} target="_blank" class="shrink-0">
<Logo class="h-5 mt-0.5 mx-2 md:hidden" iconOnly={true} width="16" /> <Logo class="h-5 mt-0.5 mx-2 md:hidden" iconOnly={true} width="16" />
<Logo class="h-5 mt-0.5 mx-2 hidden md:block" width="96" /> <Logo class="h-5 mt-0.5 mx-2 hidden md:block" width="96" />
</a> </a>
@@ -151,18 +151,27 @@
<Shortcut key="O" ctrl={true} /> <Shortcut key="O" ctrl={true} />
</Menubar.Item> </Menubar.Item>
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item on:click={dbUtils.duplicateSelection} disabled={$selection.size == 0}> <Menubar.Item
on:click={dbUtils.duplicateSelection}
disabled={$selection.size == 0}
>
<Copy size="16" class="mr-1" /> <Copy size="16" class="mr-1" />
{$_('menu.duplicate')} {$_('menu.duplicate')}
<Shortcut key="D" ctrl={true} /> <Shortcut key="D" ctrl={true} />
</Menubar.Item> </Menubar.Item>
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item on:click={dbUtils.deleteSelectedFiles} disabled={$selection.size == 0}> <Menubar.Item
on:click={dbUtils.deleteSelectedFiles}
disabled={$selection.size == 0}
>
<FileX size="16" class="mr-1" /> <FileX size="16" class="mr-1" />
{$_('menu.close')} {$_('menu.close')}
<Shortcut key="⌫" ctrl={true} /> <Shortcut key="⌫" ctrl={true} />
</Menubar.Item> </Menubar.Item>
<Menubar.Item on:click={dbUtils.deleteAllFiles} disabled={$fileObservers.size == 0}> <Menubar.Item
on:click={dbUtils.deleteAllFiles}
disabled={$fileObservers.size == 0}
>
<FileX size="16" class="mr-1" /> <FileX size="16" class="mr-1" />
{$_('menu.close_all')} {$_('menu.close_all')}
<Shortcut key="⌫" ctrl={true} shift={true} /> <Shortcut key="⌫" ctrl={true} shift={true} />
@@ -207,7 +216,11 @@
disabled={$selection.size !== 1 || disabled={$selection.size !== 1 ||
!$selection !$selection
.getSelected() .getSelected()
.every((item) => item instanceof ListFileItem || item instanceof ListTrackItem)} .every(
(item) =>
item instanceof ListFileItem ||
item instanceof ListTrackItem
)}
on:click={() => ($editMetadata = true)} on:click={() => ($editMetadata = true)}
> >
<Info size="16" class="mr-1" /> <Info size="16" class="mr-1" />
@@ -218,7 +231,11 @@
disabled={$selection.size === 0 || disabled={$selection.size === 0 ||
!$selection !$selection
.getSelected() .getSelected()
.every((item) => item instanceof ListFileItem || item instanceof ListTrackItem)} .every(
(item) =>
item instanceof ListFileItem ||
item instanceof ListTrackItem
)}
on:click={() => ($editStyle = true)} on:click={() => ($editStyle = true)}
> >
<PaintBucket size="16" class="mr-1" /> <PaintBucket size="16" class="mr-1" />
@@ -243,17 +260,20 @@
{/if} {/if}
<Shortcut key="H" ctrl={true} /> <Shortcut key="H" ctrl={true} />
</Menubar.Item> </Menubar.Item>
{#if $verticalFileView} {#if $treeFileView}
{#if $selection.getSelected().some((item) => item instanceof ListFileItem)} {#if $selection.getSelected().some((item) => item instanceof ListFileItem)}
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item <Menubar.Item
on:click={() => dbUtils.addNewTrack($selection.getSelected()[0].getFileId())} on:click={() =>
dbUtils.addNewTrack($selection.getSelected()[0].getFileId())}
disabled={$selection.size !== 1} disabled={$selection.size !== 1}
> >
<Plus size="16" class="mr-1" /> <Plus size="16" class="mr-1" />
{$_('menu.new_track')} {$_('menu.new_track')}
</Menubar.Item> </Menubar.Item>
{:else if $selection.getSelected().some((item) => item instanceof ListTrackItem)} {:else if $selection
.getSelected()
.some((item) => item instanceof ListTrackItem)}
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item <Menubar.Item
on:click={() => { on:click={() => {
@@ -284,7 +304,7 @@
{$_('menu.center')} {$_('menu.center')}
<Shortcut key="⏎" ctrl={true} /> <Shortcut key="⏎" ctrl={true} />
</Menubar.Item> </Menubar.Item>
{#if $verticalFileView} {#if $treeFileView}
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item on:click={copySelection} disabled={$selection.size === 0}> <Menubar.Item on:click={copySelection} disabled={$selection.size === 0}>
<ClipboardCopy size="16" class="mr-1" /> <ClipboardCopy size="16" class="mr-1" />
@@ -300,7 +320,9 @@
disabled={$copied === undefined || disabled={$copied === undefined ||
$copied.length === 0 || $copied.length === 0 ||
($selection.size > 0 && ($selection.size > 0 &&
!allowedPastes[$copied[0].level].includes($selection.getSelected().pop()?.level))} !allowedPastes[$copied[0].level].includes(
$selection.getSelected().pop()?.level
))}
on:click={pasteSelection} on:click={pasteSelection}
> >
<ClipboardPaste size="16" class="mr-1" /> <ClipboardPaste size="16" class="mr-1" />
@@ -309,7 +331,10 @@
</Menubar.Item> </Menubar.Item>
{/if} {/if}
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item on:click={dbUtils.deleteSelection} disabled={$selection.size == 0}> <Menubar.Item
on:click={dbUtils.deleteSelection}
disabled={$selection.size == 0}
>
<Trash2 size="16" class="mr-1" /> <Trash2 size="16" class="mr-1" />
{$_('menu.delete')} {$_('menu.delete')}
<Shortcut key="⌫" ctrl={true} /> <Shortcut key="⌫" ctrl={true} />
@@ -327,24 +352,32 @@
{$_('menu.elevation_profile')} {$_('menu.elevation_profile')}
<Shortcut key="P" ctrl={true} /> <Shortcut key="P" ctrl={true} />
</Menubar.CheckboxItem> </Menubar.CheckboxItem>
<Menubar.CheckboxItem bind:checked={$verticalFileView}> <Menubar.CheckboxItem bind:checked={$treeFileView}>
<GalleryVertical size="16" class="mr-1" /> <ListTree size="16" class="mr-1" />
{$_('menu.vertical_file_view')} {$_('menu.tree_file_view')}
<Shortcut key="L" ctrl={true} /> <Shortcut key="L" ctrl={true} />
</Menubar.CheckboxItem> </Menubar.CheckboxItem>
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item inset on:click={switchBasemaps}> <Menubar.Item inset on:click={switchBasemaps}>
<Map size="16" class="mr-1" />{$_('menu.switch_basemap')}<Shortcut key="F1" /> <Map size="16" class="mr-1" />{$_('menu.switch_basemap')}<Shortcut
key="F1"
/>
</Menubar.Item> </Menubar.Item>
<Menubar.Item inset on:click={toggleOverlays}> <Menubar.Item inset on:click={toggleOverlays}>
<Layers2 size="16" class="mr-1" />{$_('menu.toggle_overlays')}<Shortcut key="F2" /> <Layers2 size="16" class="mr-1" />{$_('menu.toggle_overlays')}<Shortcut
key="F2"
/>
</Menubar.Item> </Menubar.Item>
<Menubar.Separator /> <Menubar.Separator />
<Menubar.CheckboxItem bind:checked={$distanceMarkers}> <Menubar.CheckboxItem bind:checked={$distanceMarkers}>
<Coins size="16" class="mr-1" />{$_('menu.distance_markers')}<Shortcut key="F3" /> <Coins size="16" class="mr-1" />{$_('menu.distance_markers')}<Shortcut
key="F3"
/>
</Menubar.CheckboxItem> </Menubar.CheckboxItem>
<Menubar.CheckboxItem bind:checked={$directionMarkers}> <Menubar.CheckboxItem bind:checked={$directionMarkers}>
<Milestone size="16" class="mr-1" />{$_('menu.direction_markers')}<Shortcut key="F4" /> <Milestone size="16" class="mr-1" />{$_('menu.direction_markers')}<Shortcut
key="F4"
/>
</Menubar.CheckboxItem> </Menubar.CheckboxItem>
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item inset on:click={toggle3D}> <Menubar.Item inset on:click={toggle3D}>
@@ -368,9 +401,15 @@
</Menubar.SubTrigger> </Menubar.SubTrigger>
<Menubar.SubContent> <Menubar.SubContent>
<Menubar.RadioGroup bind:value={$distanceUnits}> <Menubar.RadioGroup bind:value={$distanceUnits}>
<Menubar.RadioItem value="metric">{$_('menu.metric')}</Menubar.RadioItem> <Menubar.RadioItem value="metric"
<Menubar.RadioItem value="imperial">{$_('menu.imperial')}</Menubar.RadioItem> >{$_('menu.metric')}</Menubar.RadioItem
<Menubar.RadioItem value="nautical">{$_('menu.nautical')}</Menubar.RadioItem> >
<Menubar.RadioItem value="imperial"
>{$_('menu.imperial')}</Menubar.RadioItem
>
<Menubar.RadioItem value="nautical"
>{$_('menu.nautical')}</Menubar.RadioItem
>
</Menubar.RadioGroup> </Menubar.RadioGroup>
</Menubar.SubContent> </Menubar.SubContent>
</Menubar.Sub> </Menubar.Sub>
@@ -380,8 +419,12 @@
</Menubar.SubTrigger> </Menubar.SubTrigger>
<Menubar.SubContent> <Menubar.SubContent>
<Menubar.RadioGroup bind:value={$velocityUnits}> <Menubar.RadioGroup bind:value={$velocityUnits}>
<Menubar.RadioItem value="speed">{$_('quantities.speed')}</Menubar.RadioItem> <Menubar.RadioItem value="speed"
<Menubar.RadioItem value="pace">{$_('quantities.pace')}</Menubar.RadioItem> >{$_('quantities.speed')}</Menubar.RadioItem
>
<Menubar.RadioItem value="pace"
>{$_('quantities.pace')}</Menubar.RadioItem
>
</Menubar.RadioGroup> </Menubar.RadioGroup>
</Menubar.SubContent> </Menubar.SubContent>
</Menubar.Sub> </Menubar.Sub>
@@ -391,8 +434,12 @@
</Menubar.SubTrigger> </Menubar.SubTrigger>
<Menubar.SubContent> <Menubar.SubContent>
<Menubar.RadioGroup bind:value={$temperatureUnits}> <Menubar.RadioGroup bind:value={$temperatureUnits}>
<Menubar.RadioItem value="celsius">{$_('menu.celsius')}</Menubar.RadioItem> <Menubar.RadioItem value="celsius"
<Menubar.RadioItem value="fahrenheit">{$_('menu.fahrenheit')}</Menubar.RadioItem> >{$_('menu.celsius')}</Menubar.RadioItem
>
<Menubar.RadioItem value="fahrenheit"
>{$_('menu.fahrenheit')}</Menubar.RadioItem
>
</Menubar.RadioGroup> </Menubar.RadioGroup>
</Menubar.SubContent> </Menubar.SubContent>
</Menubar.Sub> </Menubar.Sub>
@@ -428,8 +475,11 @@
setMode(value); setMode(value);
}} }}
> >
<Menubar.RadioItem value="light">{$_('menu.light')}</Menubar.RadioItem> <Menubar.RadioItem value="light"
<Menubar.RadioItem value="dark">{$_('menu.dark')}</Menubar.RadioItem> >{$_('menu.light')}</Menubar.RadioItem
>
<Menubar.RadioItem value="dark">{$_('menu.dark')}</Menubar.RadioItem
>
</Menubar.RadioGroup> </Menubar.RadioGroup>
</Menubar.SubContent> </Menubar.SubContent>
</Menubar.Sub> </Menubar.Sub>
@@ -441,8 +491,12 @@
</Menubar.SubTrigger> </Menubar.SubTrigger>
<Menubar.SubContent> <Menubar.SubContent>
<Menubar.RadioGroup bind:value={$streetViewSource}> <Menubar.RadioGroup bind:value={$streetViewSource}>
<Menubar.RadioItem value="mapillary">{$_('menu.mapillary')}</Menubar.RadioItem> <Menubar.RadioItem value="mapillary"
<Menubar.RadioItem value="google">{$_('menu.google')}</Menubar.RadioItem> >{$_('menu.mapillary')}</Menubar.RadioItem
>
<Menubar.RadioItem value="google"
>{$_('menu.google')}</Menubar.RadioItem
>
</Menubar.RadioGroup> </Menubar.RadioGroup>
</Menubar.SubContent> </Menubar.SubContent>
</Menubar.Sub> </Menubar.Sub>
@@ -567,7 +621,7 @@
$elevationProfile = !$elevationProfile; $elevationProfile = !$elevationProfile;
e.preventDefault(); e.preventDefault();
} else if (e.key === 'l' && (e.metaKey || e.ctrlKey)) { } else if (e.key === 'l' && (e.metaKey || e.ctrlKey)) {
$verticalFileView = !$verticalFileView; $treeFileView = !$treeFileView;
e.preventDefault(); e.preventDefault();
} else if (e.key === 'h' && (e.metaKey || e.ctrlKey)) { } else if (e.key === 'h' && (e.metaKey || e.ctrlKey)) {
if ($allHidden) { if ($allHidden) {

View File

@@ -12,7 +12,8 @@
const handleMouseMove = (event: PointerEvent) => { const handleMouseMove = (event: PointerEvent) => {
const newAfter = const newAfter =
startAfter + (orientation === 'col' ? startX - event.clientX : startY - event.clientY); startAfter +
(orientation === 'col' ? startX - event.clientX : startY - event.clientY);
if (newAfter >= minAfter && newAfter <= maxAfter) { if (newAfter >= minAfter && newAfter <= maxAfter) {
after = newAfter; after = newAfter;
} else if (newAfter < minAfter && after !== minAfter) { } else if (newAfter < minAfter && after !== minAfter) {

View File

@@ -8,7 +8,7 @@
getDistanceUnits, getDistanceUnits,
getElevationUnits, getElevationUnits,
getVelocityUnits, getVelocityUnits,
secondsToHHMMSS secondsToHHMMSS,
} from '$lib/units'; } from '$lib/units';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';

View File

@@ -43,6 +43,7 @@
:global(.markdown > a) { :global(.markdown > a) {
@apply text-link; @apply text-link;
@apply hover:underline; @apply hover:underline;
@apply contents;
} }
:global(.markdown p > a) { :global(.markdown p > a) {

View File

@@ -18,7 +18,11 @@
class="w-full max-w-3xl" class="w-full max-w-3xl"
/> />
{:else if src === 'tools/split'} {:else if src === 'tools/split'}
<enhanced:img src="/src/lib/assets/img/docs/tools/split.png" {alt} class="w-full max-w-3xl" /> <enhanced:img
src="/src/lib/assets/img/docs/tools/split.png"
{alt}
class="w-full max-w-3xl"
/>
{/if} {/if}
</div> </div>
<p class="text-center text-sm text-muted-foreground mt-2">{alt}</p> <p class="text-center text-sm text-muted-foreground mt-2">{alt}</p>

View File

@@ -1,39 +1,64 @@
import { File, FilePen, View, type Icon, Settings, Pencil, MapPin, Scissors, CalendarClock, Group, Ungroup, Filter, SquareDashedMousePointer, MountainSnow } from "lucide-svelte"; import {
import type { ComponentType } from "svelte"; File,
FilePen,
View,
type Icon,
Settings,
Pencil,
MapPin,
Scissors,
CalendarClock,
Group,
Ungroup,
Filter,
SquareDashedMousePointer,
MountainSnow,
} from 'lucide-svelte';
import type { ComponentType } from 'svelte';
export const guides: Record<string, string[]> = { export const guides: Record<string, string[]> = {
'getting-started': [], 'getting-started': [],
menu: ['file', 'edit', 'view', 'settings'], menu: ['file', 'edit', 'view', 'settings'],
'files-and-stats': [], 'files-and-stats': [],
toolbar: ['routing', 'poi', 'scissors', 'time', 'merge', 'extract', 'elevation', 'minify', 'clean'], toolbar: [
'routing',
'poi',
'scissors',
'time',
'merge',
'extract',
'elevation',
'minify',
'clean',
],
'map-controls': [], 'map-controls': [],
'gpx': [], gpx: [],
'integration': [], integration: [],
'faq': [], faq: [],
}; };
export const guideIcons: Record<string, string | ComponentType<Icon>> = { export const guideIcons: Record<string, string | ComponentType<Icon>> = {
"getting-started": "🚀", 'getting-started': '🚀',
"menu": "📂 ⚙️", menu: '📂 ⚙️',
"file": File, file: File,
"edit": FilePen, edit: FilePen,
"view": View, view: View,
"settings": Settings, settings: Settings,
"files-and-stats": "🗂 📈", 'files-and-stats': '🗂 📈',
"toolbar": "🧰", toolbar: '🧰',
"routing": Pencil, routing: Pencil,
"poi": MapPin, poi: MapPin,
"scissors": Scissors, scissors: Scissors,
"time": CalendarClock, time: CalendarClock,
"merge": Group, merge: Group,
"extract": Ungroup, extract: Ungroup,
"elevation": MountainSnow, elevation: MountainSnow,
"minify": Filter, minify: Filter,
"clean": SquareDashedMousePointer, clean: SquareDashedMousePointer,
"map-controls": "🗺", 'map-controls': '🗺',
"gpx": "💾", gpx: '💾',
"integration": "{ 👩‍💻 }", integration: '{ 👩‍💻 }',
"faq": "🔮", faq: '🔮',
}; };
export function getPreviousGuide(currentGuide: string): string | undefined { export function getPreviousGuide(currentGuide: string): string | undefined {

View File

@@ -12,7 +12,7 @@
embedding, embedding,
loadFile, loadFile,
map, map,
updateGPXData updateGPXData,
} from '$lib/stores'; } from '$lib/stores';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
import { fileObservers, settings, GPXStatisticsTree } from '$lib/db'; import { fileObservers, settings, GPXStatisticsTree } from '$lib/db';
@@ -23,7 +23,7 @@
import { import {
allowedEmbeddingBasemaps, allowedEmbeddingBasemaps,
getFilesFromEmbeddingOptions, getFilesFromEmbeddingOptions,
type EmbeddingOptions type EmbeddingOptions,
} from './Embedding'; } from './Embedding';
import { mode, setMode } from 'mode-watcher'; import { mode, setMode } from 'mode-watcher';
import { browser } from '$app/environment'; import { browser } from '$app/environment';
@@ -37,7 +37,7 @@
temperatureUnits, temperatureUnits,
fileOrder, fileOrder,
distanceMarkers, distanceMarkers,
directionMarkers directionMarkers,
} = settings; } = settings;
export let useHash = true; export let useHash = true;
@@ -50,7 +50,7 @@
distanceUnits: 'metric', distanceUnits: 'metric',
velocityUnits: 'speed', velocityUnits: 'speed',
temperatureUnits: 'celsius', temperatureUnits: 'celsius',
theme: 'system' theme: 'system',
}; };
function applyOptions() { function applyOptions() {
@@ -74,12 +74,12 @@
let bounds = { let bounds = {
southWest: { southWest: {
lat: 90, lat: 90,
lon: 180 lon: 180,
}, },
northEast: { northEast: {
lat: -90, lat: -90,
lon: -180 lon: -180,
} },
}; };
fileObservers.update(($fileObservers) => { fileObservers.update(($fileObservers) => {
@@ -96,12 +96,13 @@
id, id,
readable({ readable({
file, file,
statistics statistics,
}) })
); );
ids.push(id); ids.push(id);
let fileBounds = statistics.getStatisticsFor(new ListFileItem(id)).global.bounds; let fileBounds = statistics.getStatisticsFor(new ListFileItem(id)).global
.bounds;
bounds.southWest.lat = Math.min(bounds.southWest.lat, fileBounds.southWest.lat); bounds.southWest.lat = Math.min(bounds.southWest.lat, fileBounds.southWest.lat);
bounds.southWest.lon = Math.min(bounds.southWest.lon, fileBounds.southWest.lon); bounds.southWest.lon = Math.min(bounds.southWest.lon, fileBounds.southWest.lon);
@@ -130,12 +131,12 @@
bounds.southWest.lon, bounds.southWest.lon,
bounds.southWest.lat, bounds.southWest.lat,
bounds.northEast.lon, bounds.northEast.lon,
bounds.northEast.lat bounds.northEast.lat,
], ],
{ {
padding: 80, padding: 80,
linear: true, linear: true,
easing: () => 1 easing: () => 1,
} }
); );
} }
@@ -143,7 +144,10 @@
} }
}); });
if (options.basemap !== $currentBasemap && allowedEmbeddingBasemaps.includes(options.basemap)) { if (
options.basemap !== $currentBasemap &&
allowedEmbeddingBasemaps.includes(options.basemap)
) {
$currentBasemap = options.basemap; $currentBasemap = options.basemap;
} }
@@ -257,7 +261,7 @@
options.elevation.hr ? 'hr' : null, options.elevation.hr ? 'hr' : null,
options.elevation.cad ? 'cad' : null, options.elevation.cad ? 'cad' : null,
options.elevation.temp ? 'temp' : null, options.elevation.temp ? 'temp' : null,
options.elevation.power ? 'power' : null options.elevation.power ? 'power' : null,
].filter((dataset) => dataset !== null)} ].filter((dataset) => dataset !== null)}
elevationFill={options.elevation.fill} elevationFill={options.elevation.fill}
showControls={options.elevation.controls} showControls={options.elevation.controls}

View File

@@ -39,14 +39,14 @@ export const defaultEmbeddingOptions = {
hr: false, hr: false,
cad: false, cad: false,
temp: false, temp: false,
power: false power: false,
}, },
distanceMarkers: false, distanceMarkers: false,
directionMarkers: false, directionMarkers: false,
distanceUnits: 'metric', distanceUnits: 'metric',
velocityUnits: 'speed', velocityUnits: 'speed',
temperatureUnits: 'celsius', temperatureUnits: 'celsius',
theme: 'system' theme: 'system',
}; };
export function getDefaultEmbeddingOptions(): EmbeddingOptions { export function getDefaultEmbeddingOptions(): EmbeddingOptions {
@@ -59,7 +59,11 @@ export function getMergedEmbeddingOptions(
): EmbeddingOptions { ): EmbeddingOptions {
const mergedOptions = JSON.parse(JSON.stringify(defaultOptions)); const mergedOptions = JSON.parse(JSON.stringify(defaultOptions));
for (const key in options) { for (const key in options) {
if (typeof options[key] === 'object' && options[key] !== null && !Array.isArray(options[key])) { if (
typeof options[key] === 'object' &&
options[key] !== null &&
!Array.isArray(options[key])
) {
mergedOptions[key] = getMergedEmbeddingOptions(options[key], defaultOptions[key]); mergedOptions[key] = getMergedEmbeddingOptions(options[key], defaultOptions[key]);
} else { } else {
mergedOptions[key] = options[key]; mergedOptions[key] = options[key];
@@ -79,7 +83,10 @@ export function getCleanedEmbeddingOptions(
cleanedOptions[key] !== null && cleanedOptions[key] !== null &&
!Array.isArray(cleanedOptions[key]) !Array.isArray(cleanedOptions[key])
) { ) {
cleanedOptions[key] = getCleanedEmbeddingOptions(cleanedOptions[key], defaultOptions[key]); cleanedOptions[key] = getCleanedEmbeddingOptions(
cleanedOptions[key],
defaultOptions[key]
);
if (Object.keys(cleanedOptions[key]).length === 0) { if (Object.keys(cleanedOptions[key]).length === 0) {
delete cleanedOptions[key]; delete cleanedOptions[key];
} }
@@ -141,7 +148,7 @@ export function convertOldEmbeddingOptions(options: URLSearchParams): any {
} }
if (options.has('slope')) { if (options.has('slope')) {
newOptions.elevation = { newOptions.elevation = {
fill: 'slope' fill: 'slope',
}; };
} }
return newOptions; return newOptions;

View File

@@ -13,13 +13,13 @@
SquareActivity, SquareActivity,
Coins, Coins,
Milestone, Milestone,
Video Video,
} from 'lucide-svelte'; } from 'lucide-svelte';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import { import {
allowedEmbeddingBasemaps, allowedEmbeddingBasemaps,
getCleanedEmbeddingOptions, getCleanedEmbeddingOptions,
getDefaultEmbeddingOptions getDefaultEmbeddingOptions,
} from './Embedding'; } from './Embedding';
import { PUBLIC_MAPBOX_TOKEN } from '$env/static/public'; import { PUBLIC_MAPBOX_TOKEN } from '$env/static/public';
import Embedding from './Embedding.svelte'; import Embedding from './Embedding.svelte';
@@ -30,7 +30,7 @@
let options = getDefaultEmbeddingOptions(); let options = getDefaultEmbeddingOptions();
options.token = 'YOUR_MAPBOX_TOKEN'; options.token = 'YOUR_MAPBOX_TOKEN';
options.files = [ options.files = [
'https://raw.githubusercontent.com/gpxstudio/gpx.studio/main/gpx/test-data/simple.gpx' 'https://raw.githubusercontent.com/gpxstudio/gpx.studio/main/gpx/test-data/simple.gpx',
]; ];
let files = options.files[0]; let files = options.files[0];
@@ -130,7 +130,11 @@
<div class="grid grid-cols-2 gap-x-6 gap-y-3 rounded-md border p-3 mt-1"> <div class="grid grid-cols-2 gap-x-6 gap-y-3 rounded-md border p-3 mt-1">
<Label class="flex flex-row items-center gap-2"> <Label class="flex flex-row items-center gap-2">
{$_('embedding.height')} {$_('embedding.height')}
<Input type="number" bind:value={options.elevation.height} class="h-8 w-20" /> <Input
type="number"
bind:value={options.elevation.height}
class="h-8 w-20"
/>
</Label> </Label>
<div class="flex flex-row items-center gap-2"> <div class="flex flex-row items-center gap-2">
<span class="shrink-0"> <span class="shrink-0">
@@ -142,7 +146,11 @@
let value = selected?.value; let value = selected?.value;
if (value === 'none') { if (value === 'none') {
options.elevation.fill = undefined; options.elevation.fill = undefined;
} else if (value === 'slope' || value === 'surface' || value === 'highway') { } else if (
value === 'slope' ||
value === 'surface' ||
value === 'highway'
) {
options.elevation.fill = value; options.elevation.fill = value;
} }
}} }}
@@ -152,8 +160,10 @@
</Select.Trigger> </Select.Trigger>
<Select.Content> <Select.Content>
<Select.Item value="slope">{$_('quantities.slope')}</Select.Item> <Select.Item value="slope">{$_('quantities.slope')}</Select.Item>
<Select.Item value="surface">{$_('quantities.surface')}</Select.Item> <Select.Item value="surface">{$_('quantities.surface')}</Select.Item
<Select.Item value="highway">{$_('quantities.highway')}</Select.Item> >
<Select.Item value="highway">{$_('quantities.highway')}</Select.Item
>
<Select.Item value="none">{$_('embedding.none')}</Select.Item> <Select.Item value="none">{$_('embedding.none')}</Select.Item>
</Select.Content> </Select.Content>
</Select.Root> </Select.Root>
@@ -318,7 +328,8 @@
<Label> <Label>
{$_('embedding.code')} {$_('embedding.code')}
</Label> </Label>
<pre class="bg-primary text-primary-foreground p-3 rounded-md whitespace-normal break-all"> <pre
class="bg-primary text-primary-foreground p-3 rounded-md whitespace-normal break-all">
<code class="language-html"> <code class="language-html">
{`<iframe src="https://gpx.studio${base}/embed?options=${encodeURIComponent(JSON.stringify(getCleanedEmbeddingOptions(options)))}${hash}" width="100%" height="600px" frameborder="0" style="outline: none;"/>`} {`<iframe src="https://gpx.studio${base}/embed?options=${encodeURIComponent(JSON.stringify(getCleanedEmbeddingOptions(options)))}${hash}" width="100%" height="600px" frameborder="0" style="outline: none;"/>`}
</code> </code>

View File

@@ -17,9 +17,9 @@
setContext('orientation', orientation); setContext('orientation', orientation);
setContext('recursive', recursive); setContext('recursive', recursive);
const { verticalFileView } = settings; const { treeFileView } = settings;
verticalFileView.subscribe(($vertical) => { treeFileView.subscribe(($vertical) => {
if ($vertical) { if ($vertical) {
selection.update(($selection) => { selection.update(($selection) => {
$selection.forEach((item) => { $selection.forEach((item) => {

View File

@@ -1,8 +1,8 @@
import { dbUtils, getFile } from "$lib/db"; import { dbUtils, getFile } from '$lib/db';
import { freeze } from "immer"; import { freeze } from 'immer';
import { GPXFile, Track, TrackSegment, Waypoint } from "gpx"; import { GPXFile, Track, TrackSegment, Waypoint } from 'gpx';
import { selection } from "./Selection"; import { selection } from './Selection';
import { newGPXFile } from "$lib/stores"; import { newGPXFile } from '$lib/stores';
export enum ListLevel { export enum ListLevel {
ROOT, ROOT,
@@ -10,7 +10,7 @@ export enum ListLevel {
TRACK, TRACK,
SEGMENT, SEGMENT,
WAYPOINTS, WAYPOINTS,
WAYPOINT WAYPOINT,
} }
export const allowedMoves: Record<ListLevel, ListLevel[]> = { export const allowedMoves: Record<ListLevel, ListLevel[]> = {
@@ -19,7 +19,7 @@ export const allowedMoves: Record<ListLevel, ListLevel[]> = {
[ListLevel.TRACK]: [ListLevel.FILE, ListLevel.TRACK], [ListLevel.TRACK]: [ListLevel.FILE, ListLevel.TRACK],
[ListLevel.SEGMENT]: [ListLevel.FILE, ListLevel.TRACK, ListLevel.SEGMENT], [ListLevel.SEGMENT]: [ListLevel.FILE, ListLevel.TRACK, ListLevel.SEGMENT],
[ListLevel.WAYPOINTS]: [ListLevel.WAYPOINTS], [ListLevel.WAYPOINTS]: [ListLevel.WAYPOINTS],
[ListLevel.WAYPOINT]: [ListLevel.WAYPOINTS, ListLevel.WAYPOINT] [ListLevel.WAYPOINT]: [ListLevel.WAYPOINTS, ListLevel.WAYPOINT],
}; };
export const allowedPastes: Record<ListLevel, ListLevel[]> = { export const allowedPastes: Record<ListLevel, ListLevel[]> = {
@@ -28,7 +28,7 @@ export const allowedPastes: Record<ListLevel, ListLevel[]> = {
[ListLevel.TRACK]: [ListLevel.ROOT, ListLevel.FILE, ListLevel.TRACK], [ListLevel.TRACK]: [ListLevel.ROOT, ListLevel.FILE, ListLevel.TRACK],
[ListLevel.SEGMENT]: [ListLevel.ROOT, ListLevel.FILE, ListLevel.TRACK, ListLevel.SEGMENT], [ListLevel.SEGMENT]: [ListLevel.ROOT, ListLevel.FILE, ListLevel.TRACK, ListLevel.SEGMENT],
[ListLevel.WAYPOINTS]: [ListLevel.FILE, ListLevel.WAYPOINTS, ListLevel.WAYPOINT], [ListLevel.WAYPOINTS]: [ListLevel.FILE, ListLevel.WAYPOINTS, ListLevel.WAYPOINT],
[ListLevel.WAYPOINT]: [ListLevel.FILE, ListLevel.WAYPOINTS, ListLevel.WAYPOINT] [ListLevel.WAYPOINT]: [ListLevel.FILE, ListLevel.WAYPOINTS, ListLevel.WAYPOINT],
}; };
export abstract class ListItem { export abstract class ListItem {
@@ -322,7 +322,13 @@ export function sortItems(items: ListItem[], reverse: boolean = false) {
} }
} }
export function moveItems(fromParent: ListItem, toParent: ListItem, fromItems: ListItem[], toItems: ListItem[], remove: boolean = true) { export function moveItems(
fromParent: ListItem,
toParent: ListItem,
fromItems: ListItem[],
toItems: ListItem[],
remove: boolean = true
) {
if (fromItems.length === 0) { if (fromItems.length === 0) {
return; return;
} }
@@ -338,11 +344,18 @@ export function moveItems(fromParent: ListItem, toParent: ListItem, fromItems: L
context.push(file.clone()); context.push(file.clone());
} else if (item instanceof ListTrackItem && item.getTrackIndex() < file.trk.length) { } else if (item instanceof ListTrackItem && item.getTrackIndex() < file.trk.length) {
context.push(file.trk[item.getTrackIndex()].clone()); context.push(file.trk[item.getTrackIndex()].clone());
} else if (item instanceof ListTrackSegmentItem && item.getTrackIndex() < file.trk.length && item.getSegmentIndex() < file.trk[item.getTrackIndex()].trkseg.length) { } else if (
item instanceof ListTrackSegmentItem &&
item.getTrackIndex() < file.trk.length &&
item.getSegmentIndex() < file.trk[item.getTrackIndex()].trkseg.length
) {
context.push(file.trk[item.getTrackIndex()].trkseg[item.getSegmentIndex()].clone()); context.push(file.trk[item.getTrackIndex()].trkseg[item.getSegmentIndex()].clone());
} else if (item instanceof ListWaypointsItem) { } else if (item instanceof ListWaypointsItem) {
context.push(file.wpt.map((wpt) => wpt.clone())); context.push(file.wpt.map((wpt) => wpt.clone()));
} else if (item instanceof ListWaypointItem && item.getWaypointIndex() < file.wpt.length) { } else if (
item instanceof ListWaypointItem &&
item.getWaypointIndex() < file.wpt.length
) {
context.push(file.wpt[item.getWaypointIndex()].clone()); context.push(file.wpt[item.getWaypointIndex()].clone());
} }
} }
@@ -359,7 +372,12 @@ export function moveItems(fromParent: ListItem, toParent: ListItem, fromItems: L
if (item instanceof ListTrackItem) { if (item instanceof ListTrackItem) {
file.replaceTracks(item.getTrackIndex(), item.getTrackIndex(), []); file.replaceTracks(item.getTrackIndex(), item.getTrackIndex(), []);
} else if (item instanceof ListTrackSegmentItem) { } else if (item instanceof ListTrackSegmentItem) {
file.replaceTrackSegments(item.getTrackIndex(), item.getSegmentIndex(), item.getSegmentIndex(), []); file.replaceTrackSegments(
item.getTrackIndex(),
item.getSegmentIndex(),
item.getSegmentIndex(),
[]
);
} else if (item instanceof ListWaypointsItem) { } else if (item instanceof ListWaypointsItem) {
file.replaceWaypoints(0, file.wpt.length - 1, []); file.replaceWaypoints(0, file.wpt.length - 1, []);
} else if (item instanceof ListWaypointItem) { } else if (item instanceof ListWaypointItem) {
@@ -371,25 +389,43 @@ export function moveItems(fromParent: ListItem, toParent: ListItem, fromItems: L
toItems.forEach((item, i) => { toItems.forEach((item, i) => {
if (item instanceof ListTrackItem) { if (item instanceof ListTrackItem) {
if (context[i] instanceof Track) { if (context[i] instanceof Track) {
file.replaceTracks(item.getTrackIndex(), item.getTrackIndex() - 1, [context[i]]); file.replaceTracks(item.getTrackIndex(), item.getTrackIndex() - 1, [
context[i],
]);
} else if (context[i] instanceof TrackSegment) { } else if (context[i] instanceof TrackSegment) {
file.replaceTracks(item.getTrackIndex(), item.getTrackIndex() - 1, [new Track({ file.replaceTracks(item.getTrackIndex(), item.getTrackIndex() - 1, [
trkseg: [context[i]] new Track({
})]); trkseg: [context[i]],
}),
]);
} }
} else if (item instanceof ListTrackSegmentItem && context[i] instanceof TrackSegment) { } else if (
file.replaceTrackSegments(item.getTrackIndex(), item.getSegmentIndex(), item.getSegmentIndex() - 1, [context[i]]); item instanceof ListTrackSegmentItem &&
context[i] instanceof TrackSegment
) {
file.replaceTrackSegments(
item.getTrackIndex(),
item.getSegmentIndex(),
item.getSegmentIndex() - 1,
[context[i]]
);
} else if (item instanceof ListWaypointsItem) { } else if (item instanceof ListWaypointsItem) {
if (Array.isArray(context[i]) && context[i].length > 0 && context[i][0] instanceof Waypoint) { if (
Array.isArray(context[i]) &&
context[i].length > 0 &&
context[i][0] instanceof Waypoint
) {
file.replaceWaypoints(file.wpt.length, file.wpt.length - 1, context[i]); file.replaceWaypoints(file.wpt.length, file.wpt.length - 1, context[i]);
} else if (context[i] instanceof Waypoint) { } else if (context[i] instanceof Waypoint) {
file.replaceWaypoints(file.wpt.length, file.wpt.length - 1, [context[i]]); file.replaceWaypoints(file.wpt.length, file.wpt.length - 1, [context[i]]);
} }
} else if (item instanceof ListWaypointItem && context[i] instanceof Waypoint) { } else if (item instanceof ListWaypointItem && context[i] instanceof Waypoint) {
file.replaceWaypoints(item.getWaypointIndex(), item.getWaypointIndex() - 1, [context[i]]); file.replaceWaypoints(item.getWaypointIndex(), item.getWaypointIndex() - 1, [
context[i],
]);
} }
}); });
} },
]; ];
if (fromParent instanceof ListRootItem) { if (fromParent instanceof ListRootItem) {
@@ -400,7 +436,10 @@ export function moveItems(fromParent: ListItem, toParent: ListItem, fromItems: L
callbacks.splice(0, 1); callbacks.splice(0, 1);
} }
dbUtils.applyEachToFilesAndGlobal(files, callbacks, (files, context: (GPXFile | Track | TrackSegment | Waypoint[] | Waypoint)[]) => { dbUtils.applyEachToFilesAndGlobal(
files,
callbacks,
(files, context: (GPXFile | Track | TrackSegment | Waypoint[] | Waypoint)[]) => {
toItems.forEach((item, i) => { toItems.forEach((item, i) => {
if (item instanceof ListFileItem) { if (item instanceof ListFileItem) {
if (context[i] instanceof GPXFile) { if (context[i] instanceof GPXFile) {
@@ -421,14 +460,18 @@ export function moveItems(fromParent: ListItem, toParent: ListItem, fromItems: L
} else if (context[i] instanceof TrackSegment) { } else if (context[i] instanceof TrackSegment) {
let newFile = newGPXFile(); let newFile = newGPXFile();
newFile._data.id = item.getFileId(); newFile._data.id = item.getFileId();
newFile.replaceTracks(0, 0, [new Track({ newFile.replaceTracks(0, 0, [
trkseg: [context[i]] new Track({
})]); trkseg: [context[i]],
}),
]);
files.set(item.getFileId(), freeze(newFile)); files.set(item.getFileId(), freeze(newFile));
} }
} }
}); });
}, context); },
context
);
selection.update(($selection) => { selection.update(($selection) => {
$selection.clear(); $selection.clear();

View File

@@ -5,7 +5,7 @@
TrackSegment, TrackSegment,
Waypoint, Waypoint,
type AnyGPXTreeElement, type AnyGPXTreeElement,
type GPXTreeElement type GPXTreeElement,
} from 'gpx'; } from 'gpx';
import { CollapsibleTreeNode } from '$lib/components/collapsible-tree/index'; import { CollapsibleTreeNode } from '$lib/components/collapsible-tree/index';
import { settings, type GPXFileWithStatistics } from '$lib/db'; import { settings, type GPXFileWithStatistics } from '$lib/db';
@@ -19,7 +19,7 @@
ListWaypointItem, ListWaypointItem,
ListWaypointsItem, ListWaypointsItem,
type ListItem, type ListItem,
type ListTrackItem type ListTrackItem,
} from './FileList'; } from './FileList';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import { selection } from './Selection'; import { selection } from './Selection';
@@ -39,19 +39,20 @@
node instanceof GPXFile && item instanceof ListFileItem node instanceof GPXFile && item instanceof ListFileItem
? node.metadata.name ? node.metadata.name
: node instanceof Track : node instanceof Track
? node.name ?? `${$_('gpx.track')} ${(item as ListTrackItem).trackIndex + 1}` ? (node.name ?? `${$_('gpx.track')} ${(item as ListTrackItem).trackIndex + 1}`)
: node instanceof TrackSegment : node instanceof TrackSegment
? `${$_('gpx.segment')} ${(item as ListTrackSegmentItem).segmentIndex + 1}` ? `${$_('gpx.segment')} ${(item as ListTrackSegmentItem).segmentIndex + 1}`
: node instanceof Waypoint : node instanceof Waypoint
? node.name ?? `${$_('gpx.waypoint')} ${(item as ListWaypointItem).waypointIndex + 1}` ? (node.name ??
`${$_('gpx.waypoint')} ${(item as ListWaypointItem).waypointIndex + 1}`)
: node instanceof GPXFile && item instanceof ListWaypointsItem : node instanceof GPXFile && item instanceof ListWaypointsItem
? $_('gpx.waypoints') ? $_('gpx.waypoints')
: ''; : '';
const { verticalFileView } = settings; const { treeFileView } = settings;
function openIfSelectedChild() { function openIfSelectedChild() {
if (collapsible && get(verticalFileView) && $selection.hasAnyChildren(item, false)) { if (collapsible && get(treeFileView) && $selection.hasAnyChildren(item, false)) {
collapsible.openNode(); collapsible.openNode();
} }
} }

View File

@@ -19,7 +19,7 @@
ListWaypointsItem, ListWaypointsItem,
allowedMoves, allowedMoves,
moveItems, moveItems,
type ListItem type ListItem,
} from './FileList'; } from './FileList';
import { selection } from './Selection'; import { selection } from './Selection';
import { isMac } from '$lib/utils'; import { isMac } from '$lib/utils';
@@ -113,7 +113,7 @@
Sortable.utils.select(element); Sortable.utils.select(element);
element.scrollIntoView({ element.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',
block: 'nearest' block: 'nearest',
}); });
} else { } else {
Sortable.utils.deselect(element); Sortable.utils.deselect(element);
@@ -155,7 +155,7 @@
group: { group: {
name: sortableLevel, name: sortableLevel,
pull: allowedMoves[sortableLevel], pull: allowedMoves[sortableLevel],
put: true put: true,
}, },
direction: orientation, direction: orientation,
forceAutoScrollFallback: true, forceAutoScrollFallback: true,
@@ -233,16 +233,16 @@
moveItems(fromItem, toItem, fromItems, toItems); moveItems(fromItem, toItem, fromItems, toItems);
} }
} },
}); });
Object.defineProperty(sortable, '_item', { Object.defineProperty(sortable, '_item', {
value: item, value: item,
writable: true writable: true,
}); });
Object.defineProperty(sortable, '_waypointRoot', { Object.defineProperty(sortable, '_waypointRoot', {
value: waypointRoot, value: waypointRoot,
writable: true writable: true,
}); });
} }

View File

@@ -18,7 +18,7 @@
Maximize, Maximize,
Scissors, Scissors,
FileStack, FileStack,
FileX FileX,
} from 'lucide-svelte'; } from 'lucide-svelte';
import { import {
ListFileItem, ListFileItem,
@@ -26,7 +26,7 @@
ListTrackItem, ListTrackItem,
ListWaypointItem, ListWaypointItem,
allowedPastes, allowedPastes,
type ListItem type ListItem,
} from './FileList'; } from './FileList';
import { import {
copied, copied,
@@ -36,7 +36,7 @@
pasteSelection, pasteSelection,
selectAll, selectAll,
selectItem, selectItem,
selection selection,
} from './Selection'; } from './Selection';
import { getContext } from 'svelte'; import { getContext } from 'svelte';
import { get } from 'svelte/store'; import { get } from 'svelte/store';
@@ -47,13 +47,14 @@
embedding, embedding,
centerMapOnSelection, centerMapOnSelection,
gpxLayers, gpxLayers,
map map,
} from '$lib/stores'; } from '$lib/stores';
import { GPXTreeElement, Track, type AnyGPXTreeElement, Waypoint, GPXFile } from 'gpx'; import { GPXTreeElement, Track, type AnyGPXTreeElement, Waypoint, GPXFile } from 'gpx';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import MetadataDialog from './MetadataDialog.svelte'; import MetadataDialog from './MetadataDialog.svelte';
import StyleDialog from './StyleDialog.svelte'; import StyleDialog from './StyleDialog.svelte';
import { waypointPopup } from '$lib/components/gpx-layer/GPXLayerPopup'; import { waypointPopup } from '$lib/components/gpx-layer/GPXLayerPopup';
import { getSymbolKey, symbols } from '$lib/assets/symbols';
export let node: GPXTreeElement<AnyGPXTreeElement> | Waypoint[] | Waypoint; export let node: GPXTreeElement<AnyGPXTreeElement> | Waypoint[] | Waypoint;
export let item: ListItem; export let item: ListItem;
@@ -69,13 +70,14 @@
nodeColors = []; nodeColors = [];
if (node instanceof GPXFile) { if (node instanceof GPXFile) {
let style = node.getStyle(); let defaultColor = undefined;
let layer = gpxLayers.get(item.getFileId()); let layer = gpxLayers.get(item.getFileId());
if (layer) { if (layer) {
style.color.push(layer.layerColor); defaultColor = layer.layerColor;
} }
let style = node.getStyle(defaultColor);
style.color.forEach((c) => { style.color.forEach((c) => {
if (!nodeColors.includes(c)) { if (!nodeColors.includes(c)) {
nodeColors.push(c); nodeColors.push(c);
@@ -84,8 +86,8 @@
} else if (node instanceof Track) { } else if (node instanceof Track) {
let style = node.getStyle(); let style = node.getStyle();
if (style) { if (style) {
if (style.color && !nodeColors.includes(style.color)) { if (style['gpx_style:color'] && !nodeColors.includes(style['gpx_style:color'])) {
nodeColors.push(style.color); nodeColors.push(style['gpx_style:color']);
} }
} }
if (nodeColors.length === 0) { if (nodeColors.length === 0) {
@@ -97,6 +99,8 @@
} }
} }
$: symbolKey = node instanceof Waypoint ? getSymbolKey(node.sym) : undefined;
let openEditMetadata: boolean = false; let openEditMetadata: boolean = false;
let openEditStyle: boolean = false; let openEditStyle: boolean = false;
@@ -173,7 +177,10 @@
if (layer && file) { if (layer && file) {
let waypoint = file.wpt[item.getWaypointIndex()]; let waypoint = file.wpt[item.getWaypointIndex()];
if (waypoint) { if (waypoint) {
waypointPopup?.setItem({ item: waypoint, fileId: item.getFileId() }); waypointPopup?.setItem({
item: waypoint,
fileId: item.getFileId(),
});
} }
} }
} }
@@ -190,16 +197,30 @@
{#if item.level === ListLevel.SEGMENT} {#if item.level === ListLevel.SEGMENT}
<Waypoints size="16" class="mr-1 shrink-0" /> <Waypoints size="16" class="mr-1 shrink-0" />
{:else if item.level === ListLevel.WAYPOINT} {:else if item.level === ListLevel.WAYPOINT}
{#if symbolKey && symbols[symbolKey].icon}
<svelte:component
this={symbols[symbolKey].icon}
size="16"
class="mr-1 shrink-0"
/>
{:else}
<MapPin size="16" class="mr-1 shrink-0" /> <MapPin size="16" class="mr-1 shrink-0" />
{/if} {/if}
<span class="grow select-none truncate {orientation === 'vertical' ? 'last:mr-2' : ''}"> {/if}
<span
class="grow select-none truncate {orientation === 'vertical'
? 'last:mr-2'
: ''}"
>
{label} {label}
</span> </span>
{#if hidden} {#if hidden}
<EyeOff <EyeOff
size="12" size="12"
class="shrink-0 mt-1 ml-1 {orientation === 'vertical' ? 'mr-2' : ''} {item.level === class="shrink-0 mt-1 ml-1 {orientation === 'vertical'
ListLevel.SEGMENT || item.level === ListLevel.WAYPOINT ? 'mr-2'
: ''} {item.level === ListLevel.SEGMENT ||
item.level === ListLevel.WAYPOINT
? 'mr-3' ? 'mr-3'
: ''}" : ''}"
/> />

View File

@@ -17,15 +17,15 @@
let name: string = let name: string =
node instanceof GPXFile node instanceof GPXFile
? node.metadata.name ?? '' ? (node.metadata.name ?? '')
: node instanceof Track : node instanceof Track
? node.name ?? '' ? (node.name ?? '')
: ''; : '';
let description: string = let description: string =
node instanceof GPXFile node instanceof GPXFile
? node.metadata.desc ?? '' ? (node.metadata.desc ?? '')
: node instanceof Track : node instanceof Track
? node.desc ?? '' ? (node.desc ?? '')
: ''; : '';
$: if (!open) { $: if (!open) {

View File

@@ -1,12 +1,23 @@
import { get, writable } from "svelte/store"; import { get, writable } from 'svelte/store';
import { ListFileItem, ListItem, ListRootItem, ListTrackItem, ListTrackSegmentItem, ListWaypointItem, ListLevel, sortItems, ListWaypointsItem, moveItems } from "./FileList"; import {
import { fileObservers, getFile, getFileIds, settings } from "$lib/db"; ListFileItem,
ListItem,
ListRootItem,
ListTrackItem,
ListTrackSegmentItem,
ListWaypointItem,
ListLevel,
sortItems,
ListWaypointsItem,
moveItems,
} from './FileList';
import { fileObservers, getFile, getFileIds, settings } from '$lib/db';
export class SelectionTreeType { export class SelectionTreeType {
item: ListItem; item: ListItem;
selected: boolean; selected: boolean;
children: { children: {
[key: string | number]: SelectionTreeType [key: string | number]: SelectionTreeType;
}; };
size: number = 0; size: number = 0;
@@ -67,7 +78,11 @@ export class SelectionTreeType {
} }
hasAnyParent(item: ListItem, self: boolean = true): boolean { hasAnyParent(item: ListItem, self: boolean = true): boolean {
if (this.selected && this.item.level <= item.level && (self || this.item.level < item.level)) { if (
this.selected &&
this.item.level <= item.level &&
(self || this.item.level < item.level)
) {
return this.selected; return this.selected;
} }
let id = item.getIdAtLevel(this.item.level); let id = item.getIdAtLevel(this.item.level);
@@ -80,7 +95,11 @@ export class SelectionTreeType {
} }
hasAnyChildren(item: ListItem, self: boolean = true, ignoreIds?: (string | number)[]): boolean { hasAnyChildren(item: ListItem, self: boolean = true, ignoreIds?: (string | number)[]): boolean {
if (this.selected && this.item.level >= item.level && (self || this.item.level > item.level)) { if (
this.selected &&
this.item.level >= item.level &&
(self || this.item.level > item.level)
) {
return this.selected; return this.selected;
} }
let id = item.getIdAtLevel(this.item.level); let id = item.getIdAtLevel(this.item.level);
@@ -131,7 +150,7 @@ export class SelectionTreeType {
delete this.children[id]; delete this.children[id];
} }
} }
}; }
export const selection = writable<SelectionTreeType>(new SelectionTreeType(new ListRootItem())); export const selection = writable<SelectionTreeType>(new SelectionTreeType(new ListRootItem()));
@@ -181,7 +200,10 @@ export function selectAll() {
let file = getFile(item.getFileId()); let file = getFile(item.getFileId());
if (file) { if (file) {
file.trk[item.getTrackIndex()].trkseg.forEach((_segment, segmentId) => { file.trk[item.getTrackIndex()].trkseg.forEach((_segment, segmentId) => {
$selection.set(new ListTrackSegmentItem(item.getFileId(), item.getTrackIndex(), segmentId), true); $selection.set(
new ListTrackSegmentItem(item.getFileId(), item.getTrackIndex(), segmentId),
true
);
}); });
} }
} else if (item instanceof ListWaypointItem) { } else if (item instanceof ListWaypointItem) {
@@ -205,14 +227,24 @@ export function getOrderedSelection(reverse: boolean = false): ListItem[] {
return selected; return selected;
} }
export function applyToOrderedItemsFromFile(selectedItems: ListItem[], callback: (fileId: string, level: ListLevel | undefined, items: ListItem[]) => void, reverse: boolean = true) { export function applyToOrderedItemsFromFile(
selectedItems: ListItem[],
callback: (fileId: string, level: ListLevel | undefined, items: ListItem[]) => void,
reverse: boolean = true
) {
get(settings.fileOrder).forEach((fileId) => { get(settings.fileOrder).forEach((fileId) => {
let level: ListLevel | undefined = undefined; let level: ListLevel | undefined = undefined;
let items: ListItem[] = []; let items: ListItem[] = [];
selectedItems.forEach((item) => { selectedItems.forEach((item) => {
if (item.getFileId() === fileId) { if (item.getFileId() === fileId) {
level = item.level; level = item.level;
if (item instanceof ListFileItem || item instanceof ListTrackItem || item instanceof ListTrackSegmentItem || item instanceof ListWaypointsItem || item instanceof ListWaypointItem) { if (
item instanceof ListFileItem ||
item instanceof ListTrackItem ||
item instanceof ListTrackSegmentItem ||
item instanceof ListWaypointsItem ||
item instanceof ListWaypointItem
) {
items.push(item); items.push(item);
} }
} }
@@ -225,7 +257,10 @@ export function applyToOrderedItemsFromFile(selectedItems: ListItem[], callback:
}); });
} }
export function applyToOrderedSelectedItemsFromFile(callback: (fileId: string, level: ListLevel | undefined, items: ListItem[]) => void, reverse: boolean = true) { export function applyToOrderedSelectedItemsFromFile(
callback: (fileId: string, level: ListLevel | undefined, items: ListItem[]) => void,
reverse: boolean = true
) {
applyToOrderedItemsFromFile(get(selection).getSelected(), callback, reverse); applyToOrderedItemsFromFile(get(selection).getSelected(), callback, reverse);
} }
@@ -270,7 +305,11 @@ export function pasteSelection() {
let startIndex: number | undefined = undefined; let startIndex: number | undefined = undefined;
if (fromItems[0].level === toParent.level) { if (fromItems[0].level === toParent.level) {
if (toParent instanceof ListTrackItem || toParent instanceof ListTrackSegmentItem || toParent instanceof ListWaypointItem) { if (
toParent instanceof ListTrackItem ||
toParent instanceof ListTrackSegmentItem ||
toParent instanceof ListWaypointItem
) {
startIndex = toParent.getId() + 1; startIndex = toParent.getId() + 1;
} }
toParent = toParent.getParent(); toParent = toParent.getParent();
@@ -288,20 +327,41 @@ export function pasteSelection() {
fromItems.forEach((item, index) => { fromItems.forEach((item, index) => {
if (toParent instanceof ListFileItem) { if (toParent instanceof ListFileItem) {
if (item instanceof ListTrackItem || item instanceof ListTrackSegmentItem) { if (item instanceof ListTrackItem || item instanceof ListTrackSegmentItem) {
toItems.push(new ListTrackItem(toParent.getFileId(), (startIndex ?? toFile.trk.length) + index)); toItems.push(
new ListTrackItem(
toParent.getFileId(),
(startIndex ?? toFile.trk.length) + index
)
);
} else if (item instanceof ListWaypointsItem) { } else if (item instanceof ListWaypointsItem) {
toItems.push(new ListWaypointsItem(toParent.getFileId())); toItems.push(new ListWaypointsItem(toParent.getFileId()));
} else if (item instanceof ListWaypointItem) { } else if (item instanceof ListWaypointItem) {
toItems.push(new ListWaypointItem(toParent.getFileId(), (startIndex ?? toFile.wpt.length) + index)); toItems.push(
new ListWaypointItem(
toParent.getFileId(),
(startIndex ?? toFile.wpt.length) + index
)
);
} }
} else if (toParent instanceof ListTrackItem) { } else if (toParent instanceof ListTrackItem) {
if (item instanceof ListTrackSegmentItem) { if (item instanceof ListTrackSegmentItem) {
let toTrackIndex = toParent.getTrackIndex(); let toTrackIndex = toParent.getTrackIndex();
toItems.push(new ListTrackSegmentItem(toParent.getFileId(), toTrackIndex, (startIndex ?? toFile.trk[toTrackIndex].trkseg.length) + index)); toItems.push(
new ListTrackSegmentItem(
toParent.getFileId(),
toTrackIndex,
(startIndex ?? toFile.trk[toTrackIndex].trkseg.length) + index
)
);
} }
} else if (toParent instanceof ListWaypointsItem) { } else if (toParent instanceof ListWaypointsItem) {
if (item instanceof ListWaypointItem) { if (item instanceof ListWaypointItem) {
toItems.push(new ListWaypointItem(toParent.getFileId(), (startIndex ?? toFile.wpt.length) + index)); toItems.push(
new ListWaypointItem(
toParent.getFileId(),
(startIndex ?? toFile.wpt.length) + index
)
);
} }
} }
}); });

View File

@@ -14,20 +14,20 @@
export let item: ListItem; export let item: ListItem;
export let open = false; export let open = false;
const { defaultOpacity, defaultWeight } = settings; const { defaultOpacity, defaultWidth } = settings;
let colors: string[] = []; let colors: string[] = [];
let color: string | undefined = undefined; let color: string | undefined = undefined;
let opacity: number[] = []; let opacity: number[] = [];
let weight: number[] = []; let width: number[] = [];
let colorChanged = false; let colorChanged = false;
let opacityChanged = false; let opacityChanged = false;
let weightChanged = false; let widthChanged = false;
function setStyleInputs() { function setStyleInputs() {
colors = []; colors = [];
opacity = []; opacity = [];
weight = []; width = [];
$selection.forEach((item) => { $selection.forEach((item) => {
if (item instanceof ListFileItem) { if (item instanceof ListFileItem) {
@@ -47,9 +47,9 @@
opacity.push(o); opacity.push(o);
} }
}); });
style.weight.forEach((w) => { style.width.forEach((w) => {
if (!weight.includes(w)) { if (!width.includes(w)) {
weight.push(w); width.push(w);
} }
}); });
} }
@@ -60,14 +60,20 @@
let track = file.trk[item.getTrackIndex()]; let track = file.trk[item.getTrackIndex()];
let style = track.getStyle(); let style = track.getStyle();
if (style) { if (style) {
if (style.color && !colors.includes(style.color)) { if (
colors.push(style.color); style['gpx_style:color'] &&
!colors.includes(style['gpx_style:color'])
) {
colors.push(style['gpx_style:color']);
} }
if (style.opacity && !opacity.includes(style.opacity)) { if (
opacity.push(style.opacity); style['gpx_style:opacity'] &&
!opacity.includes(style['gpx_style:opacity'])
) {
opacity.push(style['gpx_style:opacity']);
} }
if (style.weight && !weight.includes(style.weight)) { if (style['gpx_style:width'] && !width.includes(style['gpx_style:width'])) {
weight.push(style.weight); width.push(style['gpx_style:width']);
} }
} }
if (!colors.includes(layer.layerColor)) { if (!colors.includes(layer.layerColor)) {
@@ -79,11 +85,11 @@
color = colors[0]; color = colors[0];
opacity = [opacity[0] ?? $defaultOpacity]; opacity = [opacity[0] ?? $defaultOpacity];
weight = [weight[0] ?? $defaultWeight]; width = [width[0] ?? $defaultWidth];
colorChanged = false; colorChanged = false;
opacityChanged = false; opacityChanged = false;
weightChanged = false; widthChanged = false;
} }
$: if ($selection && open) { $: if ($selection && open) {
@@ -123,37 +129,37 @@
{$_('menu.style.width')} {$_('menu.style.width')}
<div class="w-40 p-2"> <div class="w-40 p-2">
<Slider <Slider
bind:value={weight} bind:value={width}
id="weight" id="width"
min={1} min={1}
max={10} max={10}
step={1} step={1}
onValueChange={() => (weightChanged = true)} onValueChange={() => (widthChanged = true)}
/> />
</div> </div>
</Label> </Label>
<Button <Button
variant="outline" variant="outline"
disabled={!colorChanged && !opacityChanged && !weightChanged} disabled={!colorChanged && !opacityChanged && !widthChanged}
on:click={() => { on:click={() => {
let style = {}; let style = {};
if (colorChanged) { if (colorChanged) {
style.color = color; style['gpx_style:color'] = color;
} }
if (opacityChanged) { if (opacityChanged) {
style.opacity = opacity[0]; style['gpx_style:opacity'] = opacity[0];
} }
if (weightChanged) { if (widthChanged) {
style.weight = weight[0]; style['gpx_style:width'] = width[0];
} }
dbUtils.setStyleToSelection(style); dbUtils.setStyleToSelection(style);
if (item instanceof ListFileItem && $selection.size === gpxLayers.size) { if (item instanceof ListFileItem && $selection.size === gpxLayers.size) {
if (style.opacity) { if (style['gpx_style:opacity']) {
$defaultOpacity = style.opacity; $defaultOpacity = style['gpx_style:opacity'];
} }
if (style.weight) { if (style['gpx_style:width']) {
$defaultWeight = style.weight; $defaultWidth = style['gpx_style:width'];
} }
} }

View File

@@ -0,0 +1,23 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { ClipboardCopy } from 'lucide-svelte';
import { _ } from 'svelte-i18n';
import type { Coordinates } from 'gpx';
export let coordinates: Coordinates;
export let onCopy: () => void = () => {};
</script>
<Button
class="w-full px-2 py-1 h-8 justify-start {$$props.class}"
variant="outline"
on:click={() => {
navigator.clipboard.writeText(
`${coordinates.lat.toFixed(6)}, ${coordinates.lon.toFixed(6)}`
);
onCopy();
}}
>
<ClipboardCopy size="16" class="mr-1" />
{$_('menu.copy_coordinates')}
</Button>

View File

@@ -1,11 +1,17 @@
import { settings } from '$lib/db';
import { settings } from "$lib/db"; import { gpxStatistics } from '$lib/stores';
import { gpxStatistics } from "$lib/stores"; import { get } from 'svelte/store';
import { get } from "svelte/store";
const { distanceMarkers, distanceUnits } = settings; const { distanceMarkers, distanceUnits } = settings;
const stops = [[100, 0], [50, 7], [25, 8, 10], [10, 10], [5, 11], [1, 13]]; const stops = [
[100, 0],
[50, 7],
[25, 8, 10],
[10, 10],
[5, 11],
[1, 13],
];
export class DistanceMarkers { export class DistanceMarkers {
map: mapboxgl.Map; map: mapboxgl.Map;
@@ -30,7 +36,7 @@ export class DistanceMarkers {
} else { } else {
this.map.addSource('distance-markers', { this.map.addSource('distance-markers', {
type: 'geojson', type: 'geojson',
data: this.getDistanceMarkersGeoJSON() data: this.getDistanceMarkersGeoJSON(),
}); });
} }
stops.forEach(([d, minzoom, maxzoom]) => { stops.forEach(([d, minzoom, maxzoom]) => {
@@ -39,7 +45,14 @@ export class DistanceMarkers {
id: `distance-markers-${d}`, id: `distance-markers-${d}`,
type: 'symbol', type: 'symbol',
source: 'distance-markers', source: 'distance-markers',
filter: d === 5 ? ['any', ['==', ['get', 'level'], 5], ['==', ['get', 'level'], 25]] : ['==', ['get', 'level'], d], filter:
d === 5
? [
'any',
['==', ['get', 'level'], 5],
['==', ['get', 'level'], 25],
]
: ['==', ['get', 'level'], d],
minzoom: minzoom, minzoom: minzoom,
maxzoom: maxzoom ?? 24, maxzoom: maxzoom ?? 24,
layout: { layout: {
@@ -51,7 +64,7 @@ export class DistanceMarkers {
'text-color': 'black', 'text-color': 'black',
'text-halo-width': 2, 'text-halo-width': 2,
'text-halo-color': 'white', 'text-halo-color': 'white',
} },
}); });
} else { } else {
this.map.moveLayer(`distance-markers-${d}`); this.map.moveLayer(`distance-markers-${d}`);
@@ -64,13 +77,14 @@ export class DistanceMarkers {
} }
}); });
} }
} catch (e) { // No reliable way to check if the map is ready to add sources and layers } catch (e) {
// No reliable way to check if the map is ready to add sources and layers
return; return;
} }
} }
remove() { remove() {
this.unsubscribes.forEach(unsubscribe => unsubscribe()); this.unsubscribes.forEach((unsubscribe) => unsubscribe());
} }
getDistanceMarkersGeoJSON(): GeoJSON.FeatureCollection { getDistanceMarkersGeoJSON(): GeoJSON.FeatureCollection {
@@ -79,20 +93,28 @@ export class DistanceMarkers {
let features = []; let features = [];
let currentTargetDistance = 1; let currentTargetDistance = 1;
for (let i = 0; i < statistics.local.distance.total.length; i++) { for (let i = 0; i < statistics.local.distance.total.length; i++) {
if (statistics.local.distance.total[i] >= currentTargetDistance * (get(distanceUnits) === 'metric' ? 1 : 1.60934)) { if (
statistics.local.distance.total[i] >=
currentTargetDistance * (get(distanceUnits) === 'metric' ? 1 : 1.60934)
) {
let distance = currentTargetDistance.toFixed(0); let distance = currentTargetDistance.toFixed(0);
let [level, minzoom] = stops.find(([d]) => currentTargetDistance % d === 0) ?? [0, 0]; let [level, minzoom] = stops.find(([d]) => currentTargetDistance % d === 0) ?? [
0, 0,
];
features.push({ features.push({
type: 'Feature', type: 'Feature',
geometry: { geometry: {
type: 'Point', type: 'Point',
coordinates: [statistics.local.points[i].getLongitude(), statistics.local.points[i].getLatitude()] coordinates: [
statistics.local.points[i].getLongitude(),
statistics.local.points[i].getLatitude(),
],
}, },
properties: { properties: {
distance, distance,
level, level,
minzoom, minzoom,
} },
} as GeoJSON.Feature); } as GeoJSON.Feature);
currentTargetDistance += 1; currentTargetDistance += 1;
} }
@@ -100,7 +122,7 @@ export class DistanceMarkers {
return { return {
type: 'FeatureCollection', type: 'FeatureCollection',
features features,
}; };
} }
} }

View File

@@ -1,14 +1,28 @@
import { currentTool, map, Tool } from "$lib/stores"; import { currentTool, map, Tool } from '$lib/stores';
import { settings, type GPXFileWithStatistics, dbUtils } from "$lib/db"; import { settings, type GPXFileWithStatistics, dbUtils } from '$lib/db';
import { get, type Readable } from "svelte/store"; import { get, type Readable } from 'svelte/store';
import mapboxgl from "mapbox-gl"; import mapboxgl from 'mapbox-gl';
import { waypointPopup, deleteWaypoint, trackpointPopup } from "./GPXLayerPopup"; import { waypointPopup, deleteWaypoint, trackpointPopup } from './GPXLayerPopup';
import { addSelectItem, selectItem, selection } from "$lib/components/file-list/Selection"; import { addSelectItem, selectItem, selection } from '$lib/components/file-list/Selection';
import { ListTrackSegmentItem, ListWaypointItem, ListWaypointsItem, ListTrackItem, ListFileItem, ListRootItem } from "$lib/components/file-list/FileList"; import {
import { getClosestLinePoint, getElevation, resetCursor, setGrabbingCursor, setPointerCursor, setScissorsCursor } from "$lib/utils"; ListTrackSegmentItem,
import { selectedWaypoint } from "$lib/components/toolbar/tools/Waypoint.svelte"; ListWaypointItem,
import { MapPin, Square } from "lucide-static"; ListWaypointsItem,
import { getSymbolKey, symbols } from "$lib/assets/symbols"; ListTrackItem,
ListFileItem,
ListRootItem,
} from '$lib/components/file-list/FileList';
import {
getClosestLinePoint,
getElevation,
resetCursor,
setGrabbingCursor,
setPointerCursor,
setScissorsCursor,
} from '$lib/utils';
import { selectedWaypoint } from '$lib/components/toolbar/tools/Waypoint.svelte';
import { MapPin, Square } from 'lucide-static';
import { getSymbolKey, symbols } from '$lib/assets/symbols';
const colors = [ const colors = [
'#ff0000', '#ff0000',
@@ -21,7 +35,7 @@ const colors = [
'#288228', '#288228',
'#9933ff', '#9933ff',
'#50f0be', '#50f0be',
'#8c645a' '#8c645a',
]; ];
const colorCount: { [key: string]: number } = {}; const colorCount: { [key: string]: number } = {};
@@ -42,54 +56,33 @@ function decrementColor(color: string) {
} }
} }
const inspectKey = 'Shift';
let inspectKeyDown: KeyDown | null = null;
class KeyDown {
key: string;
down: boolean = false;
constructor(key: string) {
this.key = key;
document.addEventListener('keydown', this.onKeyDown);
document.addEventListener('keyup', this.onKeyUp);
}
onKeyDown = (e: KeyboardEvent) => {
if (e.key === this.key) {
this.down = true;
}
}
onKeyUp = (e: KeyboardEvent) => {
if (e.key === this.key) {
this.down = false;
}
}
isDown() {
return this.down;
}
}
function getMarkerForSymbol(symbol: string | undefined, layerColor: string) { function getMarkerForSymbol(symbol: string | undefined, layerColor: string) {
let symbolSvg = symbol ? symbols[symbol]?.iconSvg : undefined; let symbolSvg = symbol ? symbols[symbol]?.iconSvg : undefined;
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
${Square ${Square.replace('width="24"', 'width="12"')
.replace('width="24"', 'width="12"')
.replace('height="24"', 'height="12"') .replace('height="24"', 'height="12"')
.replace('stroke="currentColor"', 'stroke="SteelBlue"') .replace('stroke="currentColor"', 'stroke="SteelBlue"')
.replace('stroke-width="2"', 'stroke-width="1.5" x="9.6" y="0.4"') .replace('stroke-width="2"', 'stroke-width="1.5" x="9.6" y="0.4"')
.replace('fill="none"', `fill="${layerColor}"`)} .replace('fill="none"', `fill="${layerColor}"`)}
${MapPin ${MapPin.replace('width="24"', '')
.replace('width="24"', '')
.replace('height="24"', '') .replace('height="24"', '')
.replace('stroke="currentColor"', '') .replace('stroke="currentColor"', '')
.replace('path', `path fill="#3fb1ce" stroke="SteelBlue" stroke-width="1"`) .replace('path', `path fill="#3fb1ce" stroke="SteelBlue" stroke-width="1"`)
.replace('circle', `circle fill="${symbolSvg ? 'none' : 'white'}" stroke="${symbolSvg ? 'none' : 'white'}" stroke-width="2"`)} .replace(
${symbolSvg?.replace('width="24"', 'width="10"') 'circle',
`circle fill="${symbolSvg ? 'none' : 'white'}" stroke="${symbolSvg ? 'none' : 'white'}" stroke-width="2"`
)}
${
symbolSvg
?.replace('width="24"', 'width="10"')
.replace('height="24"', 'height="10"') .replace('height="24"', 'height="10"')
.replace('stroke="currentColor"', 'stroke="white"') .replace('stroke="currentColor"', 'stroke="white"')
.replace('stroke-width="2"', 'stroke-width="2.5" x="7" y="5"') ?? ''} .replace('stroke-width="2"', 'stroke-width="2.5" x="7" y="5"') ?? ''
}
</svg>`; </svg>`;
} }
const { directionMarkers, verticalFileView, defaultOpacity, defaultWeight } = settings; const { directionMarkers, treeFileView, defaultOpacity, defaultWidth } = settings;
export class GPXLayer { export class GPXLayer {
map: mapboxgl.Map; map: mapboxgl.Map;
@@ -108,13 +101,18 @@ export class GPXLayer {
layerOnClickBinded: (e: any) => void = this.layerOnClick.bind(this); layerOnClickBinded: (e: any) => void = this.layerOnClick.bind(this);
layerOnContextMenuBinded: (e: any) => void = this.layerOnContextMenu.bind(this); layerOnContextMenuBinded: (e: any) => void = this.layerOnContextMenu.bind(this);
constructor(map: mapboxgl.Map, fileId: string, file: Readable<GPXFileWithStatistics | undefined>) { constructor(
map: mapboxgl.Map,
fileId: string,
file: Readable<GPXFileWithStatistics | undefined>
) {
this.map = map; this.map = map;
this.fileId = fileId; this.fileId = fileId;
this.file = file; this.file = file;
this.layerColor = getColor(); this.layerColor = getColor();
this.unsubscribe.push(file.subscribe(this.updateBinded)); this.unsubscribe.push(file.subscribe(this.updateBinded));
this.unsubscribe.push(selection.subscribe($selection => { this.unsubscribe.push(
selection.subscribe(($selection) => {
let newSelected = $selection.hasAnyChildren(new ListFileItem(this.fileId)); let newSelected = $selection.hasAnyChildren(new ListFileItem(this.fileId));
if (this.selected || newSelected) { if (this.selected || newSelected) {
this.selected = newSelected; this.selected = newSelected;
@@ -123,24 +121,23 @@ export class GPXLayer {
if (newSelected) { if (newSelected) {
this.moveToFront(); this.moveToFront();
} }
})); })
);
this.unsubscribe.push(directionMarkers.subscribe(this.updateBinded)); this.unsubscribe.push(directionMarkers.subscribe(this.updateBinded));
this.unsubscribe.push(currentTool.subscribe(tool => { this.unsubscribe.push(
currentTool.subscribe((tool) => {
if (tool === Tool.WAYPOINT && !this.draggable) { if (tool === Tool.WAYPOINT && !this.draggable) {
this.draggable = true; this.draggable = true;
this.markers.forEach(marker => marker.setDraggable(true)); this.markers.forEach((marker) => marker.setDraggable(true));
} else if (tool !== Tool.WAYPOINT && this.draggable) { } else if (tool !== Tool.WAYPOINT && this.draggable) {
this.draggable = false; this.draggable = false;
this.markers.forEach(marker => marker.setDraggable(false)); this.markers.forEach((marker) => marker.setDraggable(false));
} }
})); })
);
this.draggable = get(currentTool) === Tool.WAYPOINT; this.draggable = get(currentTool) === Tool.WAYPOINT;
this.map.on('style.import.load', this.updateBinded); this.map.on('style.import.load', this.updateBinded);
if (inspectKeyDown === null) {
inspectKeyDown = new KeyDown(inspectKey);
}
} }
update() { update() {
@@ -149,7 +146,11 @@ export class GPXLayer {
return; return;
} }
if (file._data.style && file._data.style.color && this.layerColor !== `#${file._data.style.color}`) { if (
file._data.style &&
file._data.style.color &&
this.layerColor !== `#${file._data.style.color}`
) {
decrementColor(this.layerColor); decrementColor(this.layerColor);
this.layerColor = `#${file._data.style.color}`; this.layerColor = `#${file._data.style.color}`;
} }
@@ -161,7 +162,7 @@ export class GPXLayer {
} else { } else {
this.map.addSource(this.fileId, { this.map.addSource(this.fileId, {
type: 'geojson', type: 'geojson',
data: this.getGeoJSON() data: this.getGeoJSON(),
}); });
} }
@@ -172,13 +173,13 @@ export class GPXLayer {
source: this.fileId, source: this.fileId,
layout: { layout: {
'line-join': 'round', 'line-join': 'round',
'line-cap': 'round' 'line-cap': 'round',
}, },
paint: { paint: {
'line-color': ['get', 'color'], 'line-color': ['get', 'color'],
'line-width': ['get', 'weight'], 'line-width': ['get', 'width'],
'line-opacity': ['get', 'opacity'] 'line-opacity': ['get', 'opacity'],
} },
}); });
this.map.on('click', this.fileId, this.layerOnClickBinded); this.map.on('click', this.fileId, this.layerOnClickBinded);
@@ -190,7 +191,8 @@ export class GPXLayer {
if (get(directionMarkers)) { if (get(directionMarkers)) {
if (!this.map.getLayer(this.fileId + '-direction')) { if (!this.map.getLayer(this.fileId + '-direction')) {
this.map.addLayer({ this.map.addLayer(
{
id: this.fileId + '-direction', id: this.fileId + '-direction',
type: 'symbol', type: 'symbol',
source: this.fileId, source: this.fileId,
@@ -208,9 +210,11 @@ export class GPXLayer {
'text-color': 'white', 'text-color': 'white',
'text-opacity': 0.7, 'text-opacity': 0.7,
'text-halo-width': 0.2, 'text-halo-width': 0.2,
'text-halo-color': 'white' 'text-halo-color': 'white',
} },
}, this.map.getLayer('distance-markers') ? 'distance-markers' : undefined); },
this.map.getLayer('distance-markers') ? 'distance-markers' : undefined
);
} }
} else { } else {
if (this.map.getLayer(this.fileId + '-direction')) { if (this.map.getLayer(this.fileId + '-direction')) {
@@ -225,23 +229,53 @@ export class GPXLayer {
} }
}); });
this.map.setFilter(this.fileId, ['any', ...visibleItems.map(([trackIndex, segmentIndex]) => ['all', ['==', 'trackIndex', trackIndex], ['==', 'segmentIndex', segmentIndex]])], { validate: false }); this.map.setFilter(
this.fileId,
[
'any',
...visibleItems.map(([trackIndex, segmentIndex]) => [
'all',
['==', 'trackIndex', trackIndex],
['==', 'segmentIndex', segmentIndex],
]),
],
{ validate: false }
);
if (this.map.getLayer(this.fileId + '-direction')) { if (this.map.getLayer(this.fileId + '-direction')) {
this.map.setFilter(this.fileId + '-direction', ['any', ...visibleItems.map(([trackIndex, segmentIndex]) => ['all', ['==', 'trackIndex', trackIndex], ['==', 'segmentIndex', segmentIndex]])], { validate: false }); this.map.setFilter(
this.fileId + '-direction',
[
'any',
...visibleItems.map(([trackIndex, segmentIndex]) => [
'all',
['==', 'trackIndex', trackIndex],
['==', 'segmentIndex', segmentIndex],
]),
],
{ validate: false }
);
} }
} catch (e) { // No reliable way to check if the map is ready to add sources and layers } catch (e) {
// No reliable way to check if the map is ready to add sources and layers
return; return;
} }
let markerIndex = 0; let markerIndex = 0;
if (get(selection).hasAnyChildren(new ListFileItem(this.fileId))) { if (get(selection).hasAnyChildren(new ListFileItem(this.fileId))) {
file.wpt.forEach((waypoint) => { // Update markers file.wpt.forEach((waypoint) => {
// Update markers
let symbolKey = getSymbolKey(waypoint.sym); let symbolKey = getSymbolKey(waypoint.sym);
if (markerIndex < this.markers.length) { if (markerIndex < this.markers.length) {
this.markers[markerIndex].getElement().innerHTML = getMarkerForSymbol(symbolKey, this.layerColor); this.markers[markerIndex].getElement().innerHTML = getMarkerForSymbol(
symbolKey,
this.layerColor
);
this.markers[markerIndex].setLngLat(waypoint.getCoordinates()); this.markers[markerIndex].setLngLat(waypoint.getCoordinates());
Object.defineProperty(this.markers[markerIndex], '_waypoint', { value: waypoint, writable: true }); Object.defineProperty(this.markers[markerIndex], '_waypoint', {
value: waypoint,
writable: true,
});
} else { } else {
let element = document.createElement('div'); let element = document.createElement('div');
element.classList.add('w-8', 'h-8', 'drop-shadow-xl'); element.classList.add('w-8', 'h-8', 'drop-shadow-xl');
@@ -249,7 +283,7 @@ export class GPXLayer {
let marker = new mapboxgl.Marker({ let marker = new mapboxgl.Marker({
draggable: this.draggable, draggable: this.draggable,
element, element,
anchor: 'bottom' anchor: 'bottom',
}).setLngLat(waypoint.getCoordinates()); }).setLngLat(waypoint.getCoordinates());
Object.defineProperty(marker, '_waypoint', { value: waypoint, writable: true }); Object.defineProperty(marker, '_waypoint', { value: waypoint, writable: true });
let dragEndTimestamp = 0; let dragEndTimestamp = 0;
@@ -271,11 +305,21 @@ export class GPXLayer {
return; return;
} }
if (get(verticalFileView)) { if (get(treeFileView)) {
if ((e.ctrlKey || e.metaKey) && get(selection).hasAnyChildren(new ListWaypointsItem(this.fileId), false)) { if (
addSelectItem(new ListWaypointItem(this.fileId, marker._waypoint._data.index)); (e.ctrlKey || e.metaKey) &&
get(selection).hasAnyChildren(
new ListWaypointsItem(this.fileId),
false
)
) {
addSelectItem(
new ListWaypointItem(this.fileId, marker._waypoint._data.index)
);
} else { } else {
selectItem(new ListWaypointItem(this.fileId, marker._waypoint._data.index)); selectItem(
new ListWaypointItem(this.fileId, marker._waypoint._data.index)
);
} }
} else if (get(currentTool) === Tool.WAYPOINT) { } else if (get(currentTool) === Tool.WAYPOINT) {
selectedWaypoint.set([marker._waypoint, this.fileId]); selectedWaypoint.set([marker._waypoint, this.fileId]);
@@ -298,12 +342,12 @@ export class GPXLayer {
let wpt = file.wpt[marker._waypoint._data.index]; let wpt = file.wpt[marker._waypoint._data.index];
wpt.setCoordinates({ wpt.setCoordinates({
lat: latLng.lat, lat: latLng.lat,
lon: latLng.lng lon: latLng.lng,
}); });
wpt.ele = ele[0]; wpt.ele = ele[0];
}); });
}); });
dragEndTimestamp = Date.now() dragEndTimestamp = Date.now();
}); });
this.markers.push(marker); this.markers.push(marker);
} }
@@ -311,7 +355,8 @@ export class GPXLayer {
}); });
} }
while (markerIndex < this.markers.length) { // Remove extra markers while (markerIndex < this.markers.length) {
// Remove extra markers
this.markers.pop()?.remove(); this.markers.pop()?.remove();
} }
@@ -364,7 +409,10 @@ export class GPXLayer {
this.map.moveLayer(this.fileId); this.map.moveLayer(this.fileId);
} }
if (this.map.getLayer(this.fileId + '-direction')) { if (this.map.getLayer(this.fileId + '-direction')) {
this.map.moveLayer(this.fileId + '-direction', this.map.getLayer('distance-markers') ? 'distance-markers' : undefined); this.map.moveLayer(
this.fileId + '-direction',
this.map.getLayer('distance-markers') ? 'distance-markers' : undefined
);
} }
} }
@@ -372,7 +420,12 @@ export class GPXLayer {
let trackIndex = e.features[0].properties.trackIndex; let trackIndex = e.features[0].properties.trackIndex;
let segmentIndex = e.features[0].properties.segmentIndex; let segmentIndex = e.features[0].properties.segmentIndex;
if (get(currentTool) === Tool.SCISSORS && get(selection).hasAnyParent(new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex))) { if (
get(currentTool) === Tool.SCISSORS &&
get(selection).hasAnyParent(
new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)
)
) {
setScissorsCursor(); setScissorsCursor();
} else { } else {
setPointerCursor(); setPointerCursor();
@@ -384,28 +437,42 @@ export class GPXLayer {
} }
layerOnMouseMove(e: any) { layerOnMouseMove(e: any) {
if (inspectKeyDown?.isDown()) { if (e.originalEvent.shiftKey) {
let trackIndex = e.features[0].properties.trackIndex; let trackIndex = e.features[0].properties.trackIndex;
let segmentIndex = e.features[0].properties.segmentIndex; let segmentIndex = e.features[0].properties.segmentIndex;
const file = get(this.file)?.file; const file = get(this.file)?.file;
if (file) { if (file) {
const closest = getClosestLinePoint(file.trk[trackIndex].trkseg[segmentIndex].trkpt, { lat: e.lngLat.lat, lon: e.lngLat.lng }); const closest = getClosestLinePoint(
file.trk[trackIndex].trkseg[segmentIndex].trkpt,
{ lat: e.lngLat.lat, lon: e.lngLat.lng }
);
trackpointPopup?.setItem({ item: closest, fileId: this.fileId }); trackpointPopup?.setItem({ item: closest, fileId: this.fileId });
} }
} }
} }
layerOnClick(e: any) { layerOnClick(e: any) {
if (get(currentTool) === Tool.ROUTING && get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints'])) { if (
get(currentTool) === Tool.ROUTING &&
get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints'])
) {
return; return;
} }
let trackIndex = e.features[0].properties.trackIndex; let trackIndex = e.features[0].properties.trackIndex;
let segmentIndex = e.features[0].properties.segmentIndex; let segmentIndex = e.features[0].properties.segmentIndex;
if (get(currentTool) === Tool.SCISSORS && get(selection).hasAnyParent(new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex))) { if (
dbUtils.split(this.fileId, trackIndex, segmentIndex, { lat: e.lngLat.lat, lon: e.lngLat.lng }); get(currentTool) === Tool.SCISSORS &&
get(selection).hasAnyParent(
new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)
)
) {
dbUtils.split(this.fileId, trackIndex, segmentIndex, {
lat: e.lngLat.lat,
lon: e.lngLat.lng,
});
return; return;
} }
@@ -415,8 +482,12 @@ export class GPXLayer {
} }
let item = undefined; let item = undefined;
if (get(verticalFileView) && file.getSegments().length > 1) { // Select inner item if (get(treeFileView) && file.getSegments().length > 1) {
item = file.children[trackIndex].children.length > 1 ? new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex) : new ListTrackItem(this.fileId, trackIndex); // Select inner item
item =
file.children[trackIndex].children.length > 1
? new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)
: new ListTrackItem(this.fileId, trackIndex);
} else { } else {
item = new ListFileItem(this.fileId); item = new ListFileItem(this.fileId);
} }
@@ -439,13 +510,14 @@ export class GPXLayer {
if (!file) { if (!file) {
return { return {
type: 'FeatureCollection', type: 'FeatureCollection',
features: [] features: [],
}; };
} }
let data = file.toGeoJSON(); let data = file.toGeoJSON();
let trackIndex = 0, segmentIndex = 0; let trackIndex = 0,
segmentIndex = 0;
for (let feature of data.features) { for (let feature of data.features) {
if (!feature.properties) { if (!feature.properties) {
feature.properties = {}; feature.properties = {};
@@ -453,14 +525,19 @@ export class GPXLayer {
if (!feature.properties.color) { if (!feature.properties.color) {
feature.properties.color = this.layerColor; feature.properties.color = this.layerColor;
} }
if (!feature.properties.weight) {
feature.properties.weight = get(defaultWeight);
}
if (!feature.properties.opacity) { if (!feature.properties.opacity) {
feature.properties.opacity = get(defaultOpacity); feature.properties.opacity = get(defaultOpacity);
} }
if (get(selection).hasAnyParent(new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)) || get(selection).hasAnyChildren(new ListWaypointsItem(this.fileId), true)) { if (!feature.properties.width) {
feature.properties.weight = feature.properties.weight + 2; feature.properties.width = get(defaultWidth);
}
if (
get(selection).hasAnyParent(
new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)
) ||
get(selection).hasAnyChildren(new ListWaypointsItem(this.fileId), true)
) {
feature.properties.width = feature.properties.width + 2;
feature.properties.opacity = Math.min(1, feature.properties.opacity + 0.1); feature.properties.opacity = Math.min(1, feature.properties.opacity + 0.1);
} }
feature.properties.trackIndex = trackIndex; feature.properties.trackIndex = trackIndex;

View File

@@ -1,5 +1,5 @@
import { dbUtils } from "$lib/db"; import { dbUtils } from '$lib/db';
import { MapPopup } from "$lib/components/MapPopup"; import { MapPopup } from '$lib/components/MapPopup';
export let waypointPopup: MapPopup | null = null; export let waypointPopup: MapPopup | null = null;
export let trackpointPopup: MapPopup | null = null; export let trackpointPopup: MapPopup | null = null;
@@ -11,14 +11,14 @@ export function createPopups(map: mapboxgl.Map) {
focusAfterOpen: false, focusAfterOpen: false,
maxWidth: undefined, maxWidth: undefined,
offset: { offset: {
'top': [0, 0], top: [0, 0],
'top-left': [0, 0], 'top-left': [0, 0],
'top-right': [0, 0], 'top-right': [0, 0],
'bottom': [0, -30], bottom: [0, -30],
'bottom-left': [0, -30], 'bottom-left': [0, -30],
'bottom-right': [0, -30], 'bottom-right': [0, -30],
'left': [10, -15], left: [10, -15],
'right': [-10, -15], right: [-10, -15],
}, },
}); });
trackpointPopup = new MapPopup(map, { trackpointPopup = new MapPopup(map, {

View File

@@ -1,6 +1,6 @@
import { gpxStatistics, slicedGPXStatistics, currentTool, Tool } from "$lib/stores"; import { gpxStatistics, slicedGPXStatistics, currentTool, Tool } from '$lib/stores';
import mapboxgl from "mapbox-gl"; import mapboxgl from 'mapbox-gl';
import { get } from "svelte/store"; import { get } from 'svelte/store';
export class StartEndMarkers { export class StartEndMarkers {
map: mapboxgl.Map; map: mapboxgl.Map;
@@ -16,7 +16,8 @@ export class StartEndMarkers {
let endElement = document.createElement('div'); let endElement = document.createElement('div');
startElement.className = `h-4 w-4 rounded-full bg-green-500 border-2 border-white`; startElement.className = `h-4 w-4 rounded-full bg-green-500 border-2 border-white`;
endElement.className = `h-4 w-4 rounded-full border-2 border-white`; endElement.className = `h-4 w-4 rounded-full border-2 border-white`;
endElement.style.background = 'repeating-conic-gradient(#fff 0 90deg, #000 0 180deg) 0 0/8px 8px round'; endElement.style.background =
'repeating-conic-gradient(#fff 0 90deg, #000 0 180deg) 0 0/8px 8px round';
this.start = new mapboxgl.Marker({ element: startElement }); this.start = new mapboxgl.Marker({ element: startElement });
this.end = new mapboxgl.Marker({ element: endElement }); this.end = new mapboxgl.Marker({ element: endElement });
@@ -31,7 +32,11 @@ export class StartEndMarkers {
let statistics = get(slicedGPXStatistics)?.[0] ?? get(gpxStatistics); let statistics = get(slicedGPXStatistics)?.[0] ?? get(gpxStatistics);
if (statistics.local.points.length > 0 && tool !== Tool.ROUTING) { if (statistics.local.points.length > 0 && tool !== Tool.ROUTING) {
this.start.setLngLat(statistics.local.points[0].getCoordinates()).addTo(this.map); this.start.setLngLat(statistics.local.points[0].getCoordinates()).addTo(this.map);
this.end.setLngLat(statistics.local.points[statistics.local.points.length - 1].getCoordinates()).addTo(this.map); this.end
.setLngLat(
statistics.local.points[statistics.local.points.length - 1].getCoordinates()
)
.addTo(this.map);
} else { } else {
this.start.remove(); this.start.remove();
this.end.remove(); this.end.remove();
@@ -39,7 +44,7 @@ export class StartEndMarkers {
} }
remove() { remove() {
this.unsubscribes.forEach(unsubscribe => unsubscribe()); this.unsubscribes.forEach((unsubscribe) => unsubscribe());
this.start.remove(); this.start.remove();
this.end.remove(); this.end.remove();

View File

@@ -1,10 +1,12 @@
<script lang="ts"> <script lang="ts">
import type { TrackPoint } from 'gpx'; import type { TrackPoint } from 'gpx';
import type { PopupItem } from '$lib/components/MapPopup'; import type { PopupItem } from '$lib/components/MapPopup';
import CopyCoordinates from '$lib/components/gpx-layer/CopyCoordinates.svelte';
import * as Card from '$lib/components/ui/card'; import * as Card from '$lib/components/ui/card';
import WithUnits from '$lib/components/WithUnits.svelte'; import WithUnits from '$lib/components/WithUnits.svelte';
import { Compass, Mountain, Timer } from 'lucide-svelte'; import { Compass, Mountain, Timer } from 'lucide-svelte';
import { df } from '$lib/utils'; import { df } from '$lib/utils';
import { _ } from 'svelte-i18n';
export let trackpoint: PopupItem<TrackPoint>; export let trackpoint: PopupItem<TrackPoint>;
</script> </script>
@@ -32,5 +34,10 @@
{df.format(trackpoint.item.time)} {df.format(trackpoint.item.time)}
</div> </div>
{/if} {/if}
<CopyCoordinates
coordinates={trackpoint.item.attributes}
onCopy={() => trackpoint.hide?.()}
class="mt-0.5"
/>
</Card.Content> </Card.Content>
</Card.Root> </Card.Root>

View File

@@ -2,6 +2,7 @@
import * as Card from '$lib/components/ui/card'; import * as Card from '$lib/components/ui/card';
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import Shortcut from '$lib/components/Shortcut.svelte'; import Shortcut from '$lib/components/Shortcut.svelte';
import CopyCoordinates from '$lib/components/gpx-layer/CopyCoordinates.svelte';
import { deleteWaypoint } from './GPXLayerPopup'; import { deleteWaypoint } from './GPXLayerPopup';
import WithUnits from '$lib/components/WithUnits.svelte'; import WithUnits from '$lib/components/WithUnits.svelte';
import { Dot, ExternalLink, Trash2 } from 'lucide-svelte'; import { Dot, ExternalLink, Trash2 } from 'lucide-svelte';
@@ -25,8 +26,8 @@
allowedTags: ['a', 'br', 'img'], allowedTags: ['a', 'br', 'img'],
allowedAttributes: { allowedAttributes: {
a: ['href', 'target'], a: ['href', 'target'],
img: ['src'] img: ['src'],
} },
}).trim(); }).trim();
} }
</script> </script>
@@ -61,7 +62,9 @@
</span> </span>
<Dot size="16" /> <Dot size="16" />
{/if} {/if}
{waypoint.item.getLatitude().toFixed(6)}&deg; {waypoint.item.getLongitude().toFixed(6)}&deg; {waypoint.item.getLatitude().toFixed(6)}&deg; {waypoint.item
.getLongitude()
.toFixed(6)}&deg;
{#if waypoint.item.ele !== undefined} {#if waypoint.item.ele !== undefined}
<Dot size="16" /> <Dot size="16" />
<WithUnits value={waypoint.item.ele} type="elevation" /> <WithUnits value={waypoint.item.ele} type="elevation" />
@@ -75,9 +78,11 @@
<span class="whitespace-pre-wrap">{@html sanitize(waypoint.item.cmt)}</span> <span class="whitespace-pre-wrap">{@html sanitize(waypoint.item.cmt)}</span>
{/if} {/if}
</ScrollArea> </ScrollArea>
<div class="mt-2 flex flex-col gap-1">
<CopyCoordinates coordinates={waypoint.item.attributes} />
{#if $currentTool === Tool.WAYPOINT} {#if $currentTool === Tool.WAYPOINT}
<Button <Button
class="mt-2 w-full px-2 py-1 h-8 justify-start" class="w-full px-2 py-1 h-8 justify-start"
variant="outline" variant="outline"
on:click={() => deleteWaypoint(waypoint.fileId, waypoint.item._data.index)} on:click={() => deleteWaypoint(waypoint.fileId, waypoint.item._data.index)}
> >
@@ -86,6 +91,7 @@
<Shortcut shift={true} click={true} /> <Shortcut shift={true} click={true} />
</Button> </Button>
{/if} {/if}
</div>
</Card.Content> </Card.Content>
</Card.Root> </Card.Root>

View File

@@ -15,7 +15,7 @@
Trash2, Trash2,
Move, Move,
Map, Map,
Layers2 Layers2,
} from 'lucide-svelte'; } from 'lucide-svelte';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import { settings } from '$lib/db'; import { settings } from '$lib/db';
@@ -34,7 +34,7 @@
currentOverlays, currentOverlays,
previousOverlays, previousOverlays,
customBasemapOrder, customBasemapOrder,
customOverlayOrder customOverlayOrder,
} = settings; } = settings;
let name: string = ''; let name: string = '';
@@ -68,7 +68,7 @@
acc[id] = true; acc[id] = true;
return acc; return acc;
}, {}); }, {});
} },
}); });
overlaySortable = Sortable.create(overlayContainer, { overlaySortable = Sortable.create(overlayContainer, {
onSort: (e) => { onSort: (e) => {
@@ -77,7 +77,7 @@
acc[id] = true; acc[id] = true;
return acc; return acc;
}, {}); }, {});
} },
}); });
basemapSortable.sort($customBasemapOrder); basemapSortable.sort($customBasemapOrder);
@@ -118,7 +118,7 @@
maxZoom: maxZoom, maxZoom: maxZoom,
layerType: layerType, layerType: layerType,
resourceType: resourceType, resourceType: resourceType,
value: '' value: '',
}; };
if (resourceType === 'vector') { if (resourceType === 'vector') {
@@ -131,16 +131,16 @@
type: 'raster', type: 'raster',
tiles: layer.tileUrls, tiles: layer.tileUrls,
tileSize: is512 ? 512 : 256, tileSize: is512 ? 512 : 256,
maxzoom: maxZoom maxzoom: maxZoom,
} },
}, },
layers: [ layers: [
{ {
id: layerId, id: layerId,
type: 'raster', type: 'raster',
source: layerId source: layerId,
} },
] ],
}; };
} }
$customLayers[layerId] = layer; $customLayers[layerId] = layer;
@@ -230,7 +230,10 @@
layerId layerId
); );
if (Object.keys($selectedBasemapTree.basemaps['custom']).length === 0) { if (Object.keys($selectedBasemapTree.basemaps['custom']).length === 0) {
$selectedBasemapTree.basemaps = tryDeleteLayer($selectedBasemapTree.basemaps, 'custom'); $selectedBasemapTree.basemaps = tryDeleteLayer(
$selectedBasemapTree.basemaps,
'custom'
);
} }
$customBasemapOrder = $customBasemapOrder.filter((id) => id !== layerId); $customBasemapOrder = $customBasemapOrder.filter((id) => id !== layerId);
} else { } else {
@@ -247,7 +250,10 @@
layerId layerId
); );
if (Object.keys($selectedOverlayTree.overlays['custom']).length === 0) { if (Object.keys($selectedOverlayTree.overlays['custom']).length === 0) {
$selectedOverlayTree.overlays = tryDeleteLayer($selectedOverlayTree.overlays, 'custom'); $selectedOverlayTree.overlays = tryDeleteLayer(
$selectedOverlayTree.overlays,
'custom'
);
} }
$customOverlayOrder = $customOverlayOrder.filter((id) => id !== layerId); $customOverlayOrder = $customOverlayOrder.filter((id) => id !== layerId);
@@ -367,7 +373,8 @@
/> />
{#if tileUrls.length > 1} {#if tileUrls.length > 1}
<Button <Button
on:click={() => (tileUrls = tileUrls.filter((_, index) => index !== i))} on:click={() =>
(tileUrls = tileUrls.filter((_, index) => index !== i))}
variant="outline" variant="outline"
class="p-1 h-8" class="p-1 h-8"
> >
@@ -387,7 +394,14 @@
{/each} {/each}
{#if resourceType === 'raster'} {#if resourceType === 'raster'}
<Label for="maxZoom">{$_('layers.custom_layers.max_zoom')}</Label> <Label for="maxZoom">{$_('layers.custom_layers.max_zoom')}</Label>
<Input type="number" bind:value={maxZoom} id="maxZoom" min={0} max={22} class="h-8" /> <Input
type="number"
bind:value={maxZoom}
id="maxZoom"
min={0}
max={22}
class="h-8"
/>
{/if} {/if}
<Label>{$_('layers.custom_layers.layer_type')}</Label> <Label>{$_('layers.custom_layers.layer_type')}</Label>
<RadioGroup.Root bind:value={layerType} class="flex flex-row"> <RadioGroup.Root bind:value={layerType} class="flex flex-row">

View File

@@ -26,7 +26,7 @@
selectedOverlayTree, selectedOverlayTree,
selectedOverpassTree, selectedOverpassTree,
customLayers, customLayers,
opacities opacities,
} = settings; } = settings;
function setStyle() { function setStyle() {
@@ -41,7 +41,7 @@
$map.addImport( $map.addImport(
{ {
id: 'basemap', id: 'basemap',
data: basemap data: basemap,
}, },
'overlays' 'overlays'
); );
@@ -70,12 +70,12 @@
layer.paint['raster-opacity'] = $opacities[id]; layer.paint['raster-opacity'] = $opacities[id];
} }
return layer; return layer;
}) }),
}; };
} }
$map.addImport({ $map.addImport({
id, id,
data: overlay data: overlay,
}); });
} }
} catch (e) { } catch (e) {

View File

@@ -14,7 +14,7 @@
defaultBasemap, defaultBasemap,
overlays, overlays,
overlayTree, overlayTree,
overpassTree overpassTree,
} from '$lib/assets/layers'; } from '$lib/assets/layers';
import { getLayers, isSelected, toggle } from '$lib/components/layer-control/utils'; import { getLayers, isSelected, toggle } from '$lib/components/layer-control/utils';
import { settings } from '$lib/db'; import { settings } from '$lib/db';
@@ -31,7 +31,7 @@
currentBasemap, currentBasemap,
currentOverlays, currentOverlays,
customLayers, customLayers,
opacities opacities,
} = settings; } = settings;
export let open: boolean; export let open: boolean;
@@ -137,7 +137,9 @@
<Select.Content class="h-fit max-h-[40dvh] overflow-y-auto"> <Select.Content class="h-fit max-h-[40dvh] overflow-y-auto">
{#each Object.keys(overlays) as id} {#each Object.keys(overlays) as id}
{#if isSelected($selectedOverlayTree, id)} {#if isSelected($selectedOverlayTree, id)}
<Select.Item value={id}>{$_(`layers.label.${id}`)}</Select.Item> <Select.Item value={id}
>{$_(`layers.label.${id}`)}</Select.Item
>
{/if} {/if}
{/each} {/each}
{#each Object.entries($customLayers) as [id, layer]} {#each Object.entries($customLayers) as [id, layer]}
@@ -159,7 +161,13 @@
disabled={$selectedOverlay === undefined} disabled={$selectedOverlay === undefined}
onValueChange={(value) => { onValueChange={(value) => {
if ($selectedOverlay) { if ($selectedOverlay) {
if ($map && isSelected($currentOverlays, $selectedOverlay.value)) { if (
$map &&
isSelected(
$currentOverlays,
$selectedOverlay.value
)
) {
try { try {
$map.removeImport($selectedOverlay.value); $map.removeImport($selectedOverlay.value);
} catch (e) { } catch (e) {

View File

@@ -49,7 +49,13 @@
aria-label={$_(`layers.label.${id}`)} aria-label={$_(`layers.label.${id}`)}
/> />
{:else} {:else}
<input id="{name}-{id}" type="radio" {name} value={id} bind:group={selected} /> <input
id="{name}-{id}"
type="radio"
{name}
value={id}
bind:group={selected}
/>
{/if} {/if}
<Label for="{name}-{id}" class="flex flex-row items-center gap-1"> <Label for="{name}-{id}" class="flex flex-row items-center gap-1">
{#if $customLayers.hasOwnProperty(id)} {#if $customLayers.hasOwnProperty(id)}
@@ -64,7 +70,13 @@
<CollapsibleTreeNode {id}> <CollapsibleTreeNode {id}>
<span slot="trigger">{$_(`layers.label.${id}`)}</span> <span slot="trigger">{$_(`layers.label.${id}`)}</span>
<div slot="content"> <div slot="content">
<svelte:self node={node[id]} {name} bind:selected {multiple} bind:checked={checked[id]} /> <svelte:self
node={node[id]}
{name}
bind:selected
{multiple}
bind:checked={checked[id]}
/>
</div> </div>
</CollapsibleTreeNode> </CollapsibleTreeNode>
{/if} {/if}

View File

@@ -1,14 +1,12 @@
import SphericalMercator from "@mapbox/sphericalmercator"; import SphericalMercator from '@mapbox/sphericalmercator';
import { getLayers } from "./utils"; import { getLayers } from './utils';
import { get, writable } from "svelte/store"; import { get, writable } from 'svelte/store';
import { liveQuery } from "dexie"; import { liveQuery } from 'dexie';
import { db, settings } from "$lib/db"; import { db, settings } from '$lib/db';
import { overpassQueryData } from "$lib/assets/layers"; import { overpassQueryData } from '$lib/assets/layers';
import { MapPopup } from "$lib/components/MapPopup"; import { MapPopup } from '$lib/components/MapPopup';
const { const { currentOverpassQueries } = settings;
currentOverpassQueries
} = settings;
const mercator = new SphericalMercator({ const mercator = new SphericalMercator({
size: 256, size: 256,
@@ -29,7 +27,7 @@ export class OverpassLayer {
popup: MapPopup; popup: MapPopup;
currentQueries: Set<string> = new Set(); currentQueries: Set<string> = new Set();
nextQueries: Map<string, { x: number, y: number, queries: string[] }> = new Map(); nextQueries: Map<string, { x: number; y: number; queries: string[] }> = new Map();
unsubscribes: (() => void)[] = []; unsubscribes: (() => void)[] = [];
queryIfNeededBinded = this.queryIfNeeded.bind(this); queryIfNeededBinded = this.queryIfNeeded.bind(this);
@@ -50,10 +48,12 @@ export class OverpassLayer {
this.map.on('moveend', this.queryIfNeededBinded); this.map.on('moveend', this.queryIfNeededBinded);
this.map.on('style.import.load', this.updateBinded); this.map.on('style.import.load', this.updateBinded);
this.unsubscribes.push(data.subscribe(this.updateBinded)); this.unsubscribes.push(data.subscribe(this.updateBinded));
this.unsubscribes.push(currentOverpassQueries.subscribe(() => { this.unsubscribes.push(
currentOverpassQueries.subscribe(() => {
this.updateBinded(); this.updateBinded();
this.queryIfNeededBinded(); this.queryIfNeededBinded();
})); })
);
this.update(); this.update();
} }
@@ -126,8 +126,8 @@ export class OverpassLayer {
this.popup.setItem({ this.popup.setItem({
item: { item: {
...e.features[0].properties, ...e.features[0].properties,
sym: overpassQueryData[e.features[0].properties.query].symbol ?? '' sym: overpassQueryData[e.features[0].properties.query].symbol ?? '',
} },
}); });
} }
@@ -146,8 +146,19 @@ export class OverpassLayer {
continue; continue;
} }
db.overpasstiles.where('[x+y]').equals([x, y]).toArray().then((querytiles) => { db.overpasstiles
let missingQueries = queries.filter((query) => !querytiles.some((querytile) => querytile.query === query && time - querytile.time < this.expirationTime)); .where('[x+y]')
.equals([x, y])
.toArray()
.then((querytiles) => {
let missingQueries = queries.filter(
(query) =>
!querytiles.some(
(querytile) =>
querytile.query === query &&
time - querytile.time < this.expirationTime
)
);
if (missingQueries.length > 0) { if (missingQueries.length > 0) {
this.queryTile(x, y, missingQueries); this.queryTile(x, y, missingQueries);
} }
@@ -165,13 +176,16 @@ export class OverpassLayer {
const bounds = mercator.bbox(x, y, this.queryZoom); const bounds = mercator.bbox(x, y, this.queryZoom);
fetch(`${this.overpassUrl}?data=${getQueryForBounds(bounds, queries)}`) fetch(`${this.overpassUrl}?data=${getQueryForBounds(bounds, queries)}`)
.then((response) => { .then(
(response) => {
if (response.ok) { if (response.ok) {
return response.json(); return response.json();
} }
this.currentQueries.delete(`${x},${y}`); this.currentQueries.delete(`${x},${y}`);
return Promise.reject(); return Promise.reject();
}, () => (this.currentQueries.delete(`${x},${y}`))) },
() => this.currentQueries.delete(`${x},${y}`)
)
.then((data) => this.storeOverpassData(x, y, queries, data)) .then((data) => this.storeOverpassData(x, y, queries, data))
.catch(() => this.currentQueries.delete(`${x},${y}`)); .catch(() => this.currentQueries.delete(`${x},${y}`));
} }
@@ -179,7 +193,7 @@ export class OverpassLayer {
storeOverpassData(x: number, y: number, queries: string[], data: any) { storeOverpassData(x: number, y: number, queries: string[], data: any) {
let time = Date.now(); let time = Date.now();
let queryTiles = queries.map((query) => ({ x, y, query, time })); let queryTiles = queries.map((query) => ({ x, y, query, time }));
let pois: { query: string, id: number, poi: GeoJSON.Feature }[] = []; let pois: { query: string; id: number; poi: GeoJSON.Feature }[] = [];
if (data.elements === undefined) { if (data.elements === undefined) {
return; return;
@@ -195,7 +209,9 @@ export class OverpassLayer {
type: 'Feature', type: 'Feature',
geometry: { geometry: {
type: 'Point', type: 'Point',
coordinates: element.center ? [element.center.lon, element.center.lat] : [element.lon, element.lat], coordinates: element.center
? [element.center.lon, element.center.lat]
: [element.lon, element.lat],
}, },
properties: { properties: {
id: element.id, id: element.id,
@@ -203,9 +219,10 @@ export class OverpassLayer {
lon: element.center ? element.center.lon : element.lon, lon: element.center ? element.center.lon : element.lon,
query: query, query: query,
icon: `overpass-${query}`, icon: `overpass-${query}`,
tags: element.tags tags: element.tags,
type: element.type,
},
}, },
}
}); });
} }
} }
@@ -228,11 +245,13 @@ export class OverpassLayer {
if (!this.map.hasImage(`overpass-${query}`)) { if (!this.map.hasImage(`overpass-${query}`)) {
this.map.addImage(`overpass-${query}`, icon); this.map.addImage(`overpass-${query}`, icon);
} }
} };
// Lucide icons are SVG files with a 24x24 viewBox // Lucide icons are SVG files with a 24x24 viewBox
// Create a new SVG with a 32x32 viewBox and center the icon in a circle // Create a new SVG with a 32x32 viewBox and center the icon in a circle
icon.src = 'data:image/svg+xml,' + encodeURIComponent(` icon.src =
'data:image/svg+xml,' +
encodeURIComponent(`
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="20" fill="${overpassQueryData[query].icon.color}" /> <circle cx="20" cy="20" r="20" fill="${overpassQueryData[query].icon.color}" />
<g transform="translate(8 8)"> <g transform="translate(8 8)">
@@ -264,9 +283,14 @@ function getQuery(query: string) {
function getQueryItem(tags: Record<string, string | boolean | string[]>) { function getQueryItem(tags: Record<string, string | boolean | string[]>) {
let arrayEntry = Object.entries(tags).find(([_, value]) => Array.isArray(value)); let arrayEntry = Object.entries(tags).find(([_, value]) => Array.isArray(value));
if (arrayEntry !== undefined) { if (arrayEntry !== undefined) {
return arrayEntry[1].map((val) => `nwr${Object.entries(tags) return arrayEntry[1]
.map(
(val) =>
`nwr${Object.entries(tags)
.map(([tag, value]) => `[${tag}=${tag === arrayEntry[0] ? val : value}]`) .map(([tag, value]) => `[${tag}=${tag === arrayEntry[0] ? val : value}]`)
.join('')};`).join(''); .join('')};`
)
.join('');
} else { } else {
return `nwr${Object.entries(tags) return `nwr${Object.entries(tags)
.map(([tag, value]) => `[${tag}=${value}]`) .map(([tag, value]) => `[${tag}=${value}]`)
@@ -283,8 +307,9 @@ function belongsToQuery(element: any, query: string) {
} }
function belongsToQueryItem(element: any, tags: Record<string, string | boolean | string[]>) { function belongsToQueryItem(element: any, tags: Record<string, string | boolean | string[]>) {
return Object.entries(tags) return Object.entries(tags).every(([tag, value]) =>
.every(([tag, value]) => Array.isArray(value) ? value.includes(element.tags[tag]) : element.tags[tag] === value); Array.isArray(value) ? value.includes(element.tags[tag]) : element.tags[tag] === value
);
} }
function getCurrentQueries() { function getCurrentQueries() {
@@ -293,5 +318,7 @@ function getCurrentQueries() {
return []; return [];
} }
return Object.entries(getLayers(currentQueries)).filter(([_, selected]) => selected).map(([query, _]) => query); return Object.entries(getLayers(currentQueries))
.filter(([_, selected]) => selected)
.map(([query, _]) => query);
} }

View File

@@ -7,10 +7,11 @@
import { dbUtils } from '$lib/db'; import { dbUtils } from '$lib/db';
import type { PopupItem } from '$lib/components/MapPopup'; import type { PopupItem } from '$lib/components/MapPopup';
import { ScrollArea } from '$lib/components/ui/scroll-area/index.js'; import { ScrollArea } from '$lib/components/ui/scroll-area/index.js';
import type { WaypointType } from 'gpx';
export let poi: PopupItem<any>; export let poi: PopupItem<any>;
let tags = {}; let tags: { [key: string]: string } = {};
let name = ''; let name = '';
$: if (poi) { $: if (poi) {
tags = JSON.parse(poi.item.tags); tags = JSON.parse(poi.item.tags);
@@ -20,6 +21,30 @@
name = $_(`layers.label.${poi.item.query}`); name = $_(`layers.label.${poi.item.query}`);
} }
} }
function addToFile() {
const desc = Object.entries(tags)
.map(([key, value]) => `${key}: ${value}`)
.join('\n');
let wpt: WaypointType = {
attributes: {
lat: poi.item.lat,
lon: poi.item.lon,
},
name: name,
desc: desc,
cmt: desc,
sym: poi.item.sym,
};
if (tags.website) {
wpt.link = {
attributes: {
href: tags.website,
},
};
}
dbUtils.addOrUpdateWaypoint(wpt);
}
</script> </script>
<Card.Root class="border-none shadow-md text-base p-2 max-w-[50dvw]"> <Card.Root class="border-none shadow-md text-base p-2 max-w-[50dvw]">
@@ -35,7 +60,8 @@
<Button <Button
class="ml-auto p-1.5 h-8" class="ml-auto p-1.5 h-8"
variant="outline" variant="outline"
href="https://www.openstreetmap.org/edit?editor=id&node={poi.item.id}" href="https://www.openstreetmap.org/edit?editor=id&{poi.item.type ??
'node'}={poi.item.id}"
target="_blank" target="_blank"
> >
<PencilLine size="16" /> <PencilLine size="16" />
@@ -72,21 +98,7 @@
class="mt-2" class="mt-2"
variant="outline" variant="outline"
disabled={$selection.size === 0} disabled={$selection.size === 0}
on:click={() => { on:click={addToFile}
let desc = Object.entries(tags)
.map(([key, value]) => `${key}: ${value}`)
.join('\n');
dbUtils.addOrUpdateWaypoint({
attributes: {
lat: poi.item.lat,
lon: poi.item.lon
},
name: name,
desc: desc,
cmt: desc,
sym: poi.item.sym
});
}}
> >
<MapPin size="16" class="mr-1" /> <MapPin size="16" class="mr-1" />
{$_('toolbar.waypoint.add')} {$_('toolbar.waypoint.add')}

View File

@@ -1,9 +1,10 @@
import type { LayerTreeType } from "$lib/assets/layers"; import type { LayerTreeType } from '$lib/assets/layers';
import { writable } from "svelte/store"; import { writable } from 'svelte/store';
export function anySelectedLayer(node: LayerTreeType) { export function anySelectedLayer(node: LayerTreeType) {
return Object.keys(node).find((id) => { return (
if (typeof node[id] == "boolean") { Object.keys(node).find((id) => {
if (typeof node[id] == 'boolean') {
if (node[id]) { if (node[id]) {
return true; return true;
} }
@@ -13,12 +14,16 @@ export function anySelectedLayer(node: LayerTreeType) {
} }
} }
return false; return false;
}) !== undefined; }) !== undefined
);
} }
export function getLayers(node: LayerTreeType, layers: { [key: string]: boolean } = {}): { [key: string]: boolean } { export function getLayers(
node: LayerTreeType,
layers: { [key: string]: boolean } = {}
): { [key: string]: boolean } {
Object.keys(node).forEach((id) => { Object.keys(node).forEach((id) => {
if (typeof node[id] == "boolean") { if (typeof node[id] == 'boolean') {
layers[id] = node[id]; layers[id] = node[id];
} else { } else {
getLayers(node[id], layers); getLayers(node[id], layers);
@@ -32,7 +37,7 @@ export function isSelected(node: LayerTreeType, id: string) {
if (key === id) { if (key === id) {
return node[key]; return node[key];
} }
if (typeof node[key] !== "boolean" && isSelected(node[key], id)) { if (typeof node[key] !== 'boolean' && isSelected(node[key], id)) {
return true; return true;
} }
return false; return false;
@@ -43,7 +48,7 @@ export function toggle(node: LayerTreeType, id: string) {
Object.keys(node).forEach((key) => { Object.keys(node).forEach((key) => {
if (key === id) { if (key === id) {
node[key] = !node[key]; node[key] = !node[key];
} else if (typeof node[key] !== "boolean") { } else if (typeof node[key] !== 'boolean') {
toggle(node[key], id); toggle(node[key], id);
} }
}); });

View File

@@ -1,5 +1,5 @@
import { resetCursor, setCrosshairCursor } from "$lib/utils"; import { resetCursor, setCrosshairCursor } from '$lib/utils';
import type mapboxgl from "mapbox-gl"; import type mapboxgl from 'mapbox-gl';
export class GoogleRedirect { export class GoogleRedirect {
map: mapboxgl.Map; map: mapboxgl.Map;

View File

@@ -1,12 +1,14 @@
import mapboxgl, { type LayerSpecification, type VectorSourceSpecification } from "mapbox-gl"; import mapboxgl, { type LayerSpecification, type VectorSourceSpecification } from 'mapbox-gl';
import { Viewer, type ViewerBearingEvent } from 'mapillary-js/dist/mapillary.module'; import { Viewer, type ViewerBearingEvent } from 'mapillary-js/dist/mapillary.module';
import 'mapillary-js/dist/mapillary.css'; import 'mapillary-js/dist/mapillary.css';
import { resetCursor, setPointerCursor } from "$lib/utils"; import { resetCursor, setPointerCursor } from '$lib/utils';
import type { Writable } from "svelte/store"; import type { Writable } from 'svelte/store';
const mapillarySource: VectorSourceSpecification = { const mapillarySource: VectorSourceSpecification = {
type: 'vector', type: 'vector',
tiles: ['https://tiles.mapillary.com/maps/vtp/mly1_computed_public/2/{z}/{x}/{y}?access_token=MLY|4381405525255083|3204871ec181638c3c31320490f03011'], tiles: [
'https://tiles.mapillary.com/maps/vtp/mly1_computed_public/2/{z}/{x}/{y}?access_token=MLY|4381405525255083|3204871ec181638c3c31320490f03011',
],
minzoom: 6, minzoom: 6,
maxzoom: 14, maxzoom: 14,
}; };
@@ -70,7 +72,7 @@ export class MapillaryLayer {
this.marker = new mapboxgl.Marker({ this.marker = new mapboxgl.Marker({
rotationAlignment: 'map', rotationAlignment: 'map',
element element,
}); });
this.viewer.on('position', async () => { this.viewer.on('position', async () => {

View File

@@ -10,7 +10,7 @@
MapPin, MapPin,
Filter, Filter,
Scissors, Scissors,
MountainSnow MountainSnow,
} from 'lucide-svelte'; } from 'lucide-svelte';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';

View File

@@ -24,7 +24,7 @@
onMount(() => { onMount(() => {
popup = new mapboxgl.Popup({ popup = new mapboxgl.Popup({
closeButton: false, closeButton: false,
maxWidth: undefined maxWidth: undefined,
}); });
popup.setDOMContent(popupElement); popup.setDOMContent(popupElement);
popupElement.classList.remove('hidden'); popupElement.classList.remove('hidden');

View File

@@ -1,7 +1,7 @@
<script lang="ts" context="module"> <script lang="ts" context="module">
enum CleanType { enum CleanType {
INSIDE = 'inside', INSIDE = 'inside',
OUTSIDE = 'outside' OUTSIDE = 'outside',
} }
</script> </script>
@@ -41,10 +41,10 @@
[rectangleCoordinates[1].lng, rectangleCoordinates[0].lat], [rectangleCoordinates[1].lng, rectangleCoordinates[0].lat],
[rectangleCoordinates[1].lng, rectangleCoordinates[1].lat], [rectangleCoordinates[1].lng, rectangleCoordinates[1].lat],
[rectangleCoordinates[0].lng, rectangleCoordinates[1].lat], [rectangleCoordinates[0].lng, rectangleCoordinates[1].lat],
[rectangleCoordinates[0].lng, rectangleCoordinates[0].lat] [rectangleCoordinates[0].lng, rectangleCoordinates[0].lat],
] ],
] ],
} },
}; };
let source = $map.getSource('rectangle'); let source = $map.getSource('rectangle');
if (source) { if (source) {
@@ -52,7 +52,7 @@
} else { } else {
$map.addSource('rectangle', { $map.addSource('rectangle', {
type: 'geojson', type: 'geojson',
data: data data: data,
}); });
} }
if (!$map.getLayer('rectangle')) { if (!$map.getLayer('rectangle')) {
@@ -62,8 +62,8 @@
source: 'rectangle', source: 'rectangle',
paint: { paint: {
'fill-color': 'SteelBlue', 'fill-color': 'SteelBlue',
'fill-opacity': 0.5 'fill-opacity': 0.5,
} },
}); });
} }
} }
@@ -161,12 +161,12 @@
[ [
{ {
lat: Math.min(rectangleCoordinates[0].lat, rectangleCoordinates[1].lat), lat: Math.min(rectangleCoordinates[0].lat, rectangleCoordinates[1].lat),
lon: Math.min(rectangleCoordinates[0].lng, rectangleCoordinates[1].lng) lon: Math.min(rectangleCoordinates[0].lng, rectangleCoordinates[1].lng),
}, },
{ {
lat: Math.max(rectangleCoordinates[0].lat, rectangleCoordinates[1].lat), lat: Math.max(rectangleCoordinates[0].lat, rectangleCoordinates[1].lat),
lon: Math.max(rectangleCoordinates[0].lng, rectangleCoordinates[1].lng) lon: Math.max(rectangleCoordinates[0].lng, rectangleCoordinates[1].lng),
} },
], ],
cleanType === CleanType.INSIDE, cleanType === CleanType.INSIDE,
deleteTrackpoints, deleteTrackpoints,

View File

@@ -7,7 +7,7 @@
ListTrackItem, ListTrackItem,
ListTrackSegmentItem, ListTrackSegmentItem,
ListWaypointItem, ListWaypointItem,
ListWaypointsItem ListWaypointsItem,
} from '$lib/components/file-list/FileList'; } from '$lib/components/file-list/FileList';
import Help from '$lib/components/Help.svelte'; import Help from '$lib/components/Help.svelte';
import { dbUtils, getFile } from '$lib/db'; import { dbUtils, getFile } from '$lib/db';

View File

@@ -1,7 +1,7 @@
<script lang="ts" context="module"> <script lang="ts" context="module">
enum MergeType { enum MergeType {
TRACES = 'traces', TRACES = 'traces',
CONTENTS = 'contents' CONTENTS = 'contents',
} }
</script> </script>

View File

@@ -3,7 +3,11 @@
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import { Slider } from '$lib/components/ui/slider'; import { Slider } from '$lib/components/ui/slider';
import { selection } from '$lib/components/file-list/Selection'; import { selection } from '$lib/components/file-list/Selection';
import { ListItem, ListRootItem, ListTrackSegmentItem } from '$lib/components/file-list/FileList'; import {
ListItem,
ListRootItem,
ListTrackSegmentItem,
} from '$lib/components/file-list/FileList';
import Help from '$lib/components/Help.svelte'; import Help from '$lib/components/Help.svelte';
import { Filter } from 'lucide-svelte'; import { Filter } from 'lucide-svelte';
import { _, locale } from 'svelte-i18n'; import { _, locale } from 'svelte-i18n';
@@ -18,10 +22,13 @@
let sliderValue = [50]; let sliderValue = [50];
let maxPoints = 0; let maxPoints = 0;
let currentPoints = 0; let currentPoints = 0;
const minTolerance = 0.1;
const maxTolerance = 10000;
$: validSelection = $selection.hasAnyChildren(new ListRootItem(), true, ['waypoints']); $: validSelection = $selection.hasAnyChildren(new ListRootItem(), true, ['waypoints']);
$: tolerance = 2 ** (sliderValue[0] / (100 / Math.log2(10000))); $: tolerance =
minTolerance * 2 ** (sliderValue[0] / (100 / Math.log2(maxTolerance / minTolerance)));
let simplified = new Map<string, [ListItem, number, SimplifiedTrackPoint[]]>(); let simplified = new Map<string, [ListItem, number, SimplifiedTrackPoint[]]>();
let unsubscribes = new Map<string, () => void>(); let unsubscribes = new Map<string, () => void>();
@@ -32,7 +39,7 @@
let data: GeoJSON.FeatureCollection = { let data: GeoJSON.FeatureCollection = {
type: 'FeatureCollection', type: 'FeatureCollection',
features: [] features: [],
}; };
simplified.forEach(([item, maxPts, points], itemFullId) => { simplified.forEach(([item, maxPts, points], itemFullId) => {
@@ -49,10 +56,10 @@
type: 'LineString', type: 'LineString',
coordinates: current.map((point) => [ coordinates: current.map((point) => [
point.point.getLongitude(), point.point.getLongitude(),
point.point.getLatitude() point.point.getLatitude(),
]) ]),
}, },
properties: {} properties: {},
}); });
}); });
@@ -63,7 +70,7 @@
} else { } else {
$map.addSource('simplified', { $map.addSource('simplified', {
type: 'geojson', type: 'geojson',
data: data data: data,
}); });
} }
if (!$map.getLayer('simplified')) { if (!$map.getLayer('simplified')) {
@@ -73,8 +80,8 @@
source: 'simplified', source: 'simplified',
paint: { paint: {
'line-color': 'white', 'line-color': 'white',
'line-width': 3 'line-width': 3,
} },
}); });
} else { } else {
$map.moveLayer('simplified'); $map.moveLayer('simplified');
@@ -91,17 +98,23 @@
}); });
$fileObservers.forEach((fileStore, fileId) => { $fileObservers.forEach((fileStore, fileId) => {
if (!unsubscribes.has(fileId)) { if (!unsubscribes.has(fileId)) {
let unsubscribe = derived([fileStore, selection], ([fs, sel]) => [fs, sel]).subscribe( let unsubscribe = derived([fileStore, selection], ([fs, sel]) => [
([fs, sel]) => { fs,
sel,
]).subscribe(([fs, sel]) => {
if (fs) { if (fs) {
fs.file.forEachSegment((segment, trackIndex, segmentIndex) => { fs.file.forEachSegment((segment, trackIndex, segmentIndex) => {
let segmentItem = new ListTrackSegmentItem(fileId, trackIndex, segmentIndex); let segmentItem = new ListTrackSegmentItem(
fileId,
trackIndex,
segmentIndex
);
if (sel.hasAnyParent(segmentItem)) { if (sel.hasAnyParent(segmentItem)) {
let statistics = fs.statistics.getStatisticsFor(segmentItem); let statistics = fs.statistics.getStatisticsFor(segmentItem);
simplified.set(segmentItem.getFullId(), [ simplified.set(segmentItem.getFullId(), [
segmentItem, segmentItem,
statistics.local.points.length, statistics.local.points.length,
ramerDouglasPeucker(statistics.local.points, 1) ramerDouglasPeucker(statistics.local.points, minTolerance),
]); ]);
update(); update();
} else if (simplified.has(segmentItem.getFullId())) { } else if (simplified.has(segmentItem.getFullId())) {
@@ -110,8 +123,7 @@
} }
}); });
} }
} });
);
unsubscribes.set(fileId, unsubscribe); unsubscribes.set(fileId, unsubscribe);
} }
}); });
@@ -154,7 +166,7 @@
</div> </div>
<Label class="flex flex-row justify-between"> <Label class="flex flex-row justify-between">
<span>{$_('toolbar.reduce.tolerance')}</span> <span>{$_('toolbar.reduce.tolerance')}</span>
<WithUnits value={tolerance / 1000} type="distance" decimals={3} class="font-normal" /> <WithUnits value={tolerance / 1000} type="distance" decimals={4} class="font-normal" />
</Label> </Label>
<Label class="flex flex-row justify-between"> <Label class="flex flex-row justify-between">
<span>{$_('toolbar.reduce.number_of_points')}</span> <span>{$_('toolbar.reduce.number_of_points')}</span>

View File

@@ -11,7 +11,7 @@
distancePerHourToSecondsPerDistance, distancePerHourToSecondsPerDistance,
getConvertedVelocity, getConvertedVelocity,
milesToKilometers, milesToKilometers,
nauticalMilesToKilometers nauticalMilesToKilometers,
} from '$lib/units'; } from '$lib/units';
import { CalendarDate, type DateValue } from '@internationalized/date'; import { CalendarDate, type DateValue } from '@internationalized/date';
import { CalendarClock, CirclePlay, CircleStop, CircleX, Timer, Zap } from 'lucide-svelte'; import { CalendarClock, CirclePlay, CircleStop, CircleX, Timer, Zap } from 'lucide-svelte';
@@ -23,7 +23,7 @@
ListFileItem, ListFileItem,
ListRootItem, ListRootItem,
ListTrackItem, ListTrackItem,
ListTrackSegmentItem ListTrackSegmentItem,
} from '$lib/components/file-list/FileList'; } from '$lib/components/file-list/FileList';
import Help from '$lib/components/Help.svelte'; import Help from '$lib/components/Help.svelte';
import { getURLForLanguage } from '$lib/utils'; import { getURLForLanguage } from '$lib/utils';
@@ -69,14 +69,14 @@
endDate = undefined; endDate = undefined;
endTime = undefined; endTime = undefined;
} }
if ($gpxStatistics.global.time.moving) { if ($gpxStatistics.global.time.moving && $gpxStatistics.global.speed.moving) {
movingTime = $gpxStatistics.global.time.moving; movingTime = $gpxStatistics.global.time.moving;
setSpeed($gpxStatistics.global.speed.moving);
} else if ($gpxStatistics.global.time.total && $gpxStatistics.global.speed.total) {
movingTime = $gpxStatistics.global.time.total;
setSpeed($gpxStatistics.global.speed.total);
} else { } else {
movingTime = undefined; movingTime = undefined;
}
if ($gpxStatistics.global.speed.moving) {
setSpeed($gpxStatistics.global.speed.moving);
} else {
speed = undefined; speed = undefined;
} }
} }
@@ -305,7 +305,11 @@
class="grow whitespace-normal h-fit" class="grow whitespace-normal h-fit"
on:click={() => { on:click={() => {
let effectiveSpeed = getSpeed(); let effectiveSpeed = getSpeed();
if (startDate === undefined || startTime === undefined || effectiveSpeed === undefined) { if (
startDate === undefined ||
startTime === undefined ||
effectiveSpeed === undefined
) {
return; return;
} }
@@ -325,13 +329,20 @@
let fileId = item.getFileId(); let fileId = item.getFileId();
dbUtils.applyToFile(fileId, (file) => { dbUtils.applyToFile(fileId, (file) => {
if (item instanceof ListFileItem) { if (item instanceof ListFileItem) {
if (artificial) { if (artificial || !$gpxStatistics.global.time.moving) {
file.createArtificialTimestamps(getDate(startDate, startTime), movingTime); file.createArtificialTimestamps(
getDate(startDate, startTime),
movingTime
);
} else { } else {
file.changeTimestamps(getDate(startDate, startTime), effectiveSpeed, ratio); file.changeTimestamps(
getDate(startDate, startTime),
effectiveSpeed,
ratio
);
} }
} else if (item instanceof ListTrackItem) { } else if (item instanceof ListTrackItem) {
if (artificial) { if (artificial || !$gpxStatistics.global.time.moving) {
file.createArtificialTimestamps( file.createArtificialTimestamps(
getDate(startDate, startTime), getDate(startDate, startTime),
movingTime, movingTime,
@@ -346,7 +357,7 @@
); );
} }
} else if (item instanceof ListTrackSegmentItem) { } else if (item instanceof ListTrackSegmentItem) {
if (artificial) { if (artificial || !$gpxStatistics.global.time.moving) {
file.createArtificialTimestamps( file.createArtificialTimestamps(
getDate(startDate, startTime), getDate(startDate, startTime),
movingTime, movingTime,

View File

@@ -31,14 +31,14 @@
let selectedSymbol = { let selectedSymbol = {
value: '', value: '',
label: '' label: '',
}; };
const { verticalFileView } = settings; const { treeFileView } = settings;
$: canCreate = $selection.size > 0; $: canCreate = $selection.size > 0;
$: if ($verticalFileView && $selection) { $: if ($treeFileView && $selection) {
selectedWaypoint.update(() => { selectedWaypoint.update(() => {
if ($selection.size === 1) { if ($selection.size === 1) {
let item = $selection.getSelected()[0]; let item = $selection.getSelected()[0];
@@ -74,12 +74,12 @@
if (symbolKey) { if (symbolKey) {
selectedSymbol = { selectedSymbol = {
value: symbol, value: symbol,
label: $_(`gpx.symbol.${symbolKey}`) label: $_(`gpx.symbol.${symbolKey}`),
}; };
} else { } else {
selectedSymbol = { selectedSymbol = {
value: symbol, value: symbol,
label: '' label: '',
}; };
} }
longitude = parseFloat($selectedWaypoint[0].getLongitude().toFixed(6)); longitude = parseFloat($selectedWaypoint[0].getLongitude().toFixed(6));
@@ -99,7 +99,7 @@
link = ''; link = '';
selectedSymbol = { selectedSymbol = {
value: '', value: '',
label: '' label: '',
}; };
longitude = 0; longitude = 0;
latitude = 0; latitude = 0;
@@ -134,13 +134,13 @@
{ {
attributes: { attributes: {
lat: latitude, lat: latitude,
lon: longitude lon: longitude,
}, },
name: name.length > 0 ? name : undefined, name: name.length > 0 ? name : undefined,
desc: description.length > 0 ? description : undefined, desc: description.length > 0 ? description : undefined,
cmt: description.length > 0 ? description : undefined, cmt: description.length > 0 ? description : undefined,
link: link.length > 0 ? { attributes: { href: link } } : undefined, link: link.length > 0 ? { attributes: { href: link } } : undefined,
sym: selectedSymbol.value.length > 0 ? selectedSymbol.value : undefined sym: selectedSymbol.value.length > 0 ? selectedSymbol.value : undefined,
}, },
$selectedWaypoint $selectedWaypoint
? new ListWaypointItem($selectedWaypoint[1], $selectedWaypoint[0]._data.index) ? new ListWaypointItem($selectedWaypoint[1], $selectedWaypoint[0]._data.index)
@@ -195,7 +195,11 @@
/> />
<Label for="symbol">{$_('toolbar.waypoint.icon')}</Label> <Label for="symbol">{$_('toolbar.waypoint.icon')}</Label>
<Select.Root bind:selected={selectedSymbol}> <Select.Root bind:selected={selectedSymbol}>
<Select.Trigger id="symbol" class="w-full h-8" disabled={!canCreate && !$selectedWaypoint}> <Select.Trigger
id="symbol"
class="w-full h-8"
disabled={!canCreate && !$selectedWaypoint}
>
<Select.Value /> <Select.Value />
</Select.Trigger> </Select.Trigger>
<Select.Content class="max-h-60 overflow-y-scroll"> <Select.Content class="max-h-60 overflow-y-scroll">
@@ -218,7 +222,12 @@
</Select.Content> </Select.Content>
</Select.Root> </Select.Root>
<Label for="link">{$_('toolbar.waypoint.link')}</Label> <Label for="link">{$_('toolbar.waypoint.link')}</Label>
<Input bind:value={link} id="link" class="h-8" disabled={!canCreate && !$selectedWaypoint} /> <Input
bind:value={link}
id="link"
class="h-8"
disabled={!canCreate && !$selectedWaypoint}
/>
<div class="flex flex-row gap-2"> <div class="flex flex-row gap-2">
<div class="grow"> <div class="grow">
<Label for="latitude">{$_('toolbar.waypoint.latitude')}</Label> <Label for="latitude">{$_('toolbar.waypoint.latitude')}</Label>

View File

@@ -3,7 +3,6 @@
import { Switch } from '$lib/components/ui/switch'; import { Switch } from '$lib/components/ui/switch';
import { Label } from '$lib/components/ui/label/index.js'; import { Label } from '$lib/components/ui/label/index.js';
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import * as RadioGroup from '$lib/components/ui/radio-group';
import Help from '$lib/components/Help.svelte'; import Help from '$lib/components/Help.svelte';
import ButtonWithTooltip from '$lib/components/ButtonWithTooltip.svelte'; import ButtonWithTooltip from '$lib/components/ButtonWithTooltip.svelte';
import Tooltip from '$lib/components/Tooltip.svelte'; import Tooltip from '$lib/components/Tooltip.svelte';
@@ -21,21 +20,15 @@
Repeat, Repeat,
SquareArrowUpLeft, SquareArrowUpLeft,
SquareArrowOutDownRight, SquareArrowOutDownRight,
Timer
} from 'lucide-svelte'; } from 'lucide-svelte';
import { import { map, newGPXFile, routingControls, selectFileWhenLoaded } from '$lib/stores';
gpxStatistics,
map,
newGPXFile,
routingControls,
selectFileWhenLoaded
} from '$lib/stores';
import { dbUtils, getFile, getFileIds, settings } from '$lib/db'; import { dbUtils, getFile, getFileIds, settings } from '$lib/db';
import { brouterProfiles, routingProfileSelectItem } from './Routing'; import { brouterProfiles, routingProfileSelectItem } from './Routing';
import { _, locale } from 'svelte-i18n'; import { _, locale } from 'svelte-i18n';
import { RoutingControls } from './RoutingControls'; import { RoutingControls } from './RoutingControls';
import mapboxgl from 'mapbox-gl';
import { fileObservers } from '$lib/db'; import { fileObservers } from '$lib/db';
import { slide } from 'svelte/transition'; import { slide } from 'svelte/transition';
import { getOrderedSelection, selection } from '$lib/components/file-list/Selection'; import { getOrderedSelection, selection } from '$lib/components/file-list/Selection';
@@ -44,10 +37,9 @@
ListRootItem, ListRootItem,
ListTrackItem, ListTrackItem,
ListTrackSegmentItem, ListTrackSegmentItem,
type ListItem type ListItem,
} from '$lib/components/file-list/FileList'; } from '$lib/components/file-list/FileList';
import { flyAndScale, getURLForLanguage, resetCursor, setCrosshairCursor } from '$lib/utils'; import { flyAndScale, getURLForLanguage, resetCursor, setCrosshairCursor } from '$lib/utils';
import { TimestampsMode } from '$lib/types';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
import { TrackPoint } from 'gpx'; import { TrackPoint } from 'gpx';
@@ -57,7 +49,7 @@
export let popupElement: HTMLElement | undefined = undefined; export let popupElement: HTMLElement | undefined = undefined;
let selectedItem: ListItem | null = null; let selectedItem: ListItem | null = null;
const { privateRoads, routing, timestampsMode } = settings; const { privateRoads, routing } = settings;
$: if ($map && popup && popupElement) { $: if ($map && popup && popupElement) {
// remove controls for deleted files // remove controls for deleted files
@@ -76,7 +68,10 @@
// add controls for new files // add controls for new files
$fileObservers.forEach((file, fileId) => { $fileObservers.forEach((file, fileId) => {
if (!routingControls.has(fileId)) { if (!routingControls.has(fileId)) {
routingControls.set(fileId, new RoutingControls($map, fileId, file, popup, popupElement)); routingControls.set(
fileId,
new RoutingControls($map, fileId, file, popup, popupElement)
);
} }
}); });
} }
@@ -90,9 +85,9 @@
new TrackPoint({ new TrackPoint({
attributes: { attributes: {
lat: e.lngLat.lat, lat: e.lngLat.lat,
lon: e.lngLat.lng lon: e.lngLat.lng,
} },
}) }),
]); ]);
file._data.id = getFileIds(1)[0]; file._data.id = getFileIds(1)[0];
dbUtils.add(file); dbUtils.add(file);
@@ -169,7 +164,7 @@
</Select.Root> </Select.Root>
</Label> </Label>
<Label class="flex flex-row justify-between items-center gap-2"> <Label class="flex flex-row justify-between items-center gap-2">
<span class="flex flex-row items-center gap-1"> <span class="flex flex-row gap-1">
<TriangleAlert size="16" /> <TriangleAlert size="16" />
{$_('toolbar.routing.allow_private')} {$_('toolbar.routing.allow_private')}
</span> </span>
@@ -177,28 +172,6 @@
</Label> </Label>
</div> </div>
{/if} {/if}
{#if $gpxStatistics.global.time.total > 0}
<RadioGroup.Root bind:value={$timestampsMode}>
<div class="flex flex-row items-center gap-2">
<RadioGroup.Item
value={TimestampsMode.PRESERVE_AVERAGE_SPEED}
id={TimestampsMode.PRESERVE_AVERAGE_SPEED}
/>
<Label for={TimestampsMode.PRESERVE_AVERAGE_SPEED}>
{$_('toolbar.routing.preserve_average_speed')}
</Label>
</div>
<div class="flex flex-row items-center gap-2">
<RadioGroup.Item
value={TimestampsMode.PRESERVE_TIMESTAMPS}
id={TimestampsMode.PRESERVE_TIMESTAMPS}
/>
<Label for={TimestampsMode.PRESERVE_TIMESTAMPS}>
{$_('toolbar.routing.preserve_timestamps')}
</Label>
</div>
</RadioGroup.Root>
{/if}
</div> </div>
<div class="flex flex-row flex-wrap justify-center gap-1"> <div class="flex flex-row flex-wrap justify-center gap-1">
<ButtonWithTooltip <ButtonWithTooltip
@@ -225,7 +198,8 @@
if (selected[0] instanceof ListFileItem) { if (selected[0] instanceof ListFileItem) {
return firstFile.trk[0]?.trkseg[0]?.trkpt[0]; return firstFile.trk[0]?.trkseg[0]?.trkpt[0];
} else if (selected[0] instanceof ListTrackItem) { } else if (selected[0] instanceof ListTrackItem) {
return firstFile.trk[selected[0].getTrackIndex()]?.trkseg[0]?.trkpt[0]; return firstFile.trk[selected[0].getTrackIndex()]?.trkseg[0]
?.trkpt[0];
} else if (selected[0] instanceof ListTrackSegmentItem) { } else if (selected[0] instanceof ListTrackSegmentItem) {
return firstFile.trk[selected[0].getTrackIndex()]?.trkseg[ return firstFile.trk[selected[0].getTrackIndex()]?.trkseg[
selected[0].getSegmentIndex() selected[0].getSegmentIndex()

View File

@@ -1,9 +1,9 @@
import type { Coordinates } from "gpx"; import type { Coordinates } from 'gpx';
import { TrackPoint, distance } from "gpx"; import { TrackPoint, distance } from 'gpx';
import { derived, get, writable } from "svelte/store"; import { derived, get, writable } from 'svelte/store';
import { settings } from "$lib/db"; import { settings } from '$lib/db';
import { _, isLoading, locale } from "svelte-i18n"; import { _, isLoading, locale } from 'svelte-i18n';
import { getElevation } from "$lib/utils"; import { getElevation } from '$lib/utils';
const { routing, routingProfile, privateRoads } = settings; const { routing, routingProfile, privateRoads } = settings;
@@ -15,22 +15,31 @@ export const brouterProfiles: { [key: string]: string } = {
foot: 'Hiking-Alpine-SAC6', foot: 'Hiking-Alpine-SAC6',
motorcycle: 'Car-FastEco', motorcycle: 'Car-FastEco',
water: 'river', water: 'river',
railway: 'rail' railway: 'rail',
}; };
export const routingProfileSelectItem = writable({ export const routingProfileSelectItem = writable({
value: '', value: '',
label: '' label: '',
}); });
derived([routingProfile, locale, isLoading], ([profile, l, i]) => [profile, l, i]).subscribe(([profile, l, i]) => { derived([routingProfile, locale, isLoading], ([profile, l, i]) => [profile, l, i]).subscribe(
if (!i && profile !== '' && (profile !== get(routingProfileSelectItem).value || get(_)(`toolbar.routing.activities.${profile}`) !== get(routingProfileSelectItem).label) && l !== null) { ([profile, l, i]) => {
if (
!i &&
profile !== '' &&
(profile !== get(routingProfileSelectItem).value ||
get(_)(`toolbar.routing.activities.${profile}`) !==
get(routingProfileSelectItem).label) &&
l !== null
) {
routingProfileSelectItem.update((item) => { routingProfileSelectItem.update((item) => {
item.value = profile; item.value = profile;
item.label = get(_)(`toolbar.routing.activities.${profile}`); item.label = get(_)(`toolbar.routing.activities.${profile}`);
return item; return item;
}); });
} }
}); }
);
routingProfileSelectItem.subscribe((item) => { routingProfileSelectItem.subscribe((item) => {
if (item.value !== '' && item.value !== get(routingProfile)) { if (item.value !== '' && item.value !== get(routingProfile)) {
routingProfile.set(item.value); routingProfile.set(item.value);
@@ -45,8 +54,12 @@ export function route(points: Coordinates[]): Promise<TrackPoint[]> {
} }
} }
async function getRoute(points: Coordinates[], brouterProfile: string, privateRoads: boolean): Promise<TrackPoint[]> { async function getRoute(
let url = `https://routing.gpx.studio?lonlats=${points.map(point => `${point.lon.toFixed(8)},${point.lat.toFixed(8)}`).join('|')}&profile=${brouterProfile + (privateRoads ? '-private' : '')}&format=geojson&alternativeidx=0`; points: Coordinates[],
brouterProfile: string,
privateRoads: boolean
): Promise<TrackPoint[]> {
let url = `https://brouter.gpx.studio?lonlats=${points.map((point) => `${point.lon.toFixed(8)},${point.lat.toFixed(8)}`).join('|')}&profile=${brouterProfile + (privateRoads ? '-private' : '')}&format=geojson&alternativeidx=0`;
let response = await fetch(url); let response = await fetch(url);
@@ -61,25 +74,29 @@ async function getRoute(points: Coordinates[], brouterProfile: string, privateRo
let coordinates = geojson.features[0].geometry.coordinates; let coordinates = geojson.features[0].geometry.coordinates;
let messages = geojson.features[0].properties.messages; let messages = geojson.features[0].properties.messages;
const lngIdx = messages[0].indexOf("Longitude"); const lngIdx = messages[0].indexOf('Longitude');
const latIdx = messages[0].indexOf("Latitude"); const latIdx = messages[0].indexOf('Latitude');
const tagIdx = messages[0].indexOf("WayTags"); const tagIdx = messages[0].indexOf('WayTags');
let messageIdx = 1; let messageIdx = 1;
let tags = messageIdx < messages.length ? getTags(messages[messageIdx][tagIdx]) : {}; let tags = messageIdx < messages.length ? getTags(messages[messageIdx][tagIdx]) : {};
for (let i = 0; i < coordinates.length; i++) { for (let i = 0; i < coordinates.length; i++) {
let coord = coordinates[i]; let coord = coordinates[i];
route.push(new TrackPoint({ route.push(
new TrackPoint({
attributes: { attributes: {
lat: coord[1], lat: coord[1],
lon: coord[0] lon: coord[0],
}, },
ele: coord[2] ?? (i > 0 ? route[i - 1].ele : 0) ele: coord[2] ?? (i > 0 ? route[i - 1].ele : 0),
})); })
);
if (messageIdx < messages.length && if (
messageIdx < messages.length &&
coordinates[i][0] == Number(messages[messageIdx][lngIdx]) / 1000000 && coordinates[i][0] == Number(messages[messageIdx][lngIdx]) / 1000000 &&
coordinates[i][1] == Number(messages[messageIdx][latIdx]) / 1000000) { coordinates[i][1] == Number(messages[messageIdx][latIdx]) / 1000000
) {
messageIdx++; messageIdx++;
if (messageIdx == messages.length) tags = {}; if (messageIdx == messages.length) tags = {};
@@ -93,10 +110,10 @@ async function getRoute(points: Coordinates[], brouterProfile: string, privateRo
} }
function getTags(message: string): { [key: string]: string } { function getTags(message: string): { [key: string]: string } {
const fields = message.split(" "); const fields = message.split(' ');
let tags: { [key: string]: string } = {}; let tags: { [key: string]: string } = {};
for (let i = 0; i < fields.length; i++) { for (let i = 0; i < fields.length; i++) {
let [key, value] = fields[i].split("="); let [key, value] = fields[i].split('=');
key = key.replace(/:/g, '_'); key = key.replace(/:/g, '_');
tags[key] = value; tags[key] = value;
} }
@@ -107,26 +124,31 @@ function getIntermediatePoints(points: Coordinates[]): Promise<TrackPoint[]> {
let route: TrackPoint[] = []; let route: TrackPoint[] = [];
let step = 0.05; let step = 0.05;
for (let i = 0; i < points.length - 1; i++) { // Add intermediate points between each pair of points for (let i = 0; i < points.length - 1; i++) {
// Add intermediate points between each pair of points
let dist = distance(points[i], points[i + 1]) / 1000; let dist = distance(points[i], points[i + 1]) / 1000;
for (let d = 0; d < dist; d += step) { for (let d = 0; d < dist; d += step) {
let lat = points[i].lat + d / dist * (points[i + 1].lat - points[i].lat); let lat = points[i].lat + (d / dist) * (points[i + 1].lat - points[i].lat);
let lon = points[i].lon + d / dist * (points[i + 1].lon - points[i].lon); let lon = points[i].lon + (d / dist) * (points[i + 1].lon - points[i].lon);
route.push(new TrackPoint({ route.push(
new TrackPoint({
attributes: { attributes: {
lat: lat, lat: lat,
lon: lon lon: lon,
} },
})); })
);
} }
} }
route.push(new TrackPoint({ route.push(
new TrackPoint({
attributes: { attributes: {
lat: points[points.length - 1].lat, lat: points[points.length - 1].lat,
lon: points[points.length - 1].lon lon: points[points.length - 1].lon,
} },
})); })
);
return getElevation(route).then((elevations) => { return getElevation(route).then((elevations) => {
route.forEach((point, i) => { route.forEach((point, i) => {

View File

@@ -1,18 +1,20 @@
import { distance, type Coordinates, TrackPoint, TrackSegment, Track, projectedPoint } from "gpx"; import { distance, type Coordinates, TrackPoint, TrackSegment, Track, projectedPoint } from 'gpx';
import { get, writable, type Readable } from "svelte/store"; import { get, writable, type Readable } from 'svelte/store';
import mapboxgl from "mapbox-gl"; import mapboxgl from 'mapbox-gl';
import { route } from "./Routing"; import { route } from './Routing';
import { toast } from "svelte-sonner"; import { toast } from 'svelte-sonner';
import { _ } from "svelte-i18n"; import { _ } from 'svelte-i18n';
import { dbUtils, settings, type GPXFileWithStatistics } from "$lib/db"; import { dbUtils, settings, type GPXFileWithStatistics } from '$lib/db';
import { getOrderedSelection, selection } from "$lib/components/file-list/Selection"; import { getOrderedSelection, selection } from '$lib/components/file-list/Selection';
import { ListFileItem, ListTrackItem, ListTrackSegmentItem } from "$lib/components/file-list/FileList"; import {
import { currentTool, streetViewEnabled, Tool } from "$lib/stores"; ListFileItem,
import { getClosestLinePoint, resetCursor, setGrabbingCursor } from "$lib/utils"; ListTrackItem,
import { TimestampsMode } from "$lib/types"; ListTrackSegmentItem,
} from '$lib/components/file-list/FileList';
const { streetViewSource, timestampsMode } = settings; import { currentTool, streetViewEnabled, Tool } from '$lib/stores';
import { getClosestLinePoint, resetCursor, setGrabbingCursor } from '$lib/utils';
const { streetViewSource } = settings;
export const canChangeStart = writable(false); export const canChangeStart = writable(false);
function stopPropagation(e: any) { function stopPropagation(e: any) {
@@ -30,15 +32,22 @@ export class RoutingControls {
popupElement: HTMLElement; popupElement: HTMLElement;
temporaryAnchor: AnchorWithMarker; temporaryAnchor: AnchorWithMarker;
lastDragEvent = 0; lastDragEvent = 0;
fileUnsubscribe: () => void = () => { }; fileUnsubscribe: () => void = () => {};
unsubscribes: Function[] = []; unsubscribes: Function[] = [];
toggleAnchorsForZoomLevelAndBoundsBinded: () => void = this.toggleAnchorsForZoomLevelAndBounds.bind(this); toggleAnchorsForZoomLevelAndBoundsBinded: () => void =
this.toggleAnchorsForZoomLevelAndBounds.bind(this);
showTemporaryAnchorBinded: (e: any) => void = this.showTemporaryAnchor.bind(this); showTemporaryAnchorBinded: (e: any) => void = this.showTemporaryAnchor.bind(this);
updateTemporaryAnchorBinded: (e: any) => void = this.updateTemporaryAnchor.bind(this); updateTemporaryAnchorBinded: (e: any) => void = this.updateTemporaryAnchor.bind(this);
appendAnchorBinded: (e: mapboxgl.MapMouseEvent) => void = this.appendAnchor.bind(this); appendAnchorBinded: (e: mapboxgl.MapMouseEvent) => void = this.appendAnchor.bind(this);
constructor(map: mapboxgl.Map, fileId: string, file: Readable<GPXFileWithStatistics | undefined>, popup: mapboxgl.Popup, popupElement: HTMLElement) { constructor(
map: mapboxgl.Map,
fileId: string,
file: Readable<GPXFileWithStatistics | undefined>,
popup: mapboxgl.Popup,
popupElement: HTMLElement
) {
this.map = map; this.map = map;
this.fileId = fileId; this.fileId = fileId;
this.file = file; this.file = file;
@@ -48,8 +57,8 @@ export class RoutingControls {
let point = new TrackPoint({ let point = new TrackPoint({
attributes: { attributes: {
lat: 0, lat: 0,
lon: 0 lon: 0,
} },
}); });
this.temporaryAnchor = this.createAnchor(point, new TrackSegment(), 0, 0); this.temporaryAnchor = this.createAnchor(point, new TrackSegment(), 0, 0);
this.temporaryAnchor.marker.getElement().classList.remove('z-10'); // Show below the other markers this.temporaryAnchor.marker.getElement().classList.remove('z-10'); // Show below the other markers
@@ -67,7 +76,9 @@ export class RoutingControls {
return; return;
} }
let selected = get(selection).hasAnyChildren(new ListFileItem(this.fileId), true, ['waypoints']); let selected = get(selection).hasAnyChildren(new ListFileItem(this.fileId), true, [
'waypoints',
]);
if (selected) { if (selected) {
if (this.active) { if (this.active) {
this.updateControls(); this.updateControls();
@@ -90,7 +101,8 @@ export class RoutingControls {
this.fileUnsubscribe = this.file.subscribe(this.updateControls.bind(this)); this.fileUnsubscribe = this.file.subscribe(this.updateControls.bind(this));
} }
updateControls() { // Update the markers when the file changes updateControls() {
// Update the markers when the file changes
let file = get(this.file)?.file; let file = get(this.file)?.file;
if (!file) { if (!file) {
return; return;
@@ -98,8 +110,13 @@ export class RoutingControls {
let anchorIndex = 0; let anchorIndex = 0;
file.forEachSegment((segment, trackIndex, segmentIndex) => { file.forEachSegment((segment, trackIndex, segmentIndex) => {
if (get(selection).hasAnyParent(new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex))) { if (
for (let point of segment.trkpt) { // Update the existing anchors (could be improved by matching the existing anchors with the new ones?) get(selection).hasAnyParent(
new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)
)
) {
for (let point of segment.trkpt) {
// Update the existing anchors (could be improved by matching the existing anchors with the new ones?)
if (point._data.anchor) { if (point._data.anchor) {
if (anchorIndex < this.anchors.length) { if (anchorIndex < this.anchors.length) {
this.anchors[anchorIndex].point = point; this.anchors[anchorIndex].point = point;
@@ -108,7 +125,9 @@ export class RoutingControls {
this.anchors[anchorIndex].segmentIndex = segmentIndex; this.anchors[anchorIndex].segmentIndex = segmentIndex;
this.anchors[anchorIndex].marker.setLngLat(point.getCoordinates()); this.anchors[anchorIndex].marker.setLngLat(point.getCoordinates());
} else { } else {
this.anchors.push(this.createAnchor(point, segment, trackIndex, segmentIndex)); this.anchors.push(
this.createAnchor(point, segment, trackIndex, segmentIndex)
);
} }
anchorIndex++; anchorIndex++;
} }
@@ -116,7 +135,8 @@ export class RoutingControls {
} }
}); });
while (anchorIndex < this.anchors.length) { // Remove the extra anchors while (anchorIndex < this.anchors.length) {
// Remove the extra anchors
this.anchors.pop()?.marker.remove(); this.anchors.pop()?.marker.remove();
} }
@@ -143,14 +163,19 @@ export class RoutingControls {
this.map = map; this.map = map;
} }
createAnchor(point: TrackPoint, segment: TrackSegment, trackIndex: number, segmentIndex: number): AnchorWithMarker { createAnchor(
point: TrackPoint,
segment: TrackSegment,
trackIndex: number,
segmentIndex: number
): AnchorWithMarker {
let element = document.createElement('div'); let element = document.createElement('div');
element.className = `h-5 w-5 xs:h-4 xs:w-4 md:h-3 md:w-3 rounded-full bg-white border-2 border-black cursor-pointer`; element.className = `h-5 w-5 xs:h-4 xs:w-4 md:h-3 md:w-3 rounded-full bg-white border-2 border-black cursor-pointer`;
let marker = new mapboxgl.Marker({ let marker = new mapboxgl.Marker({
draggable: true, draggable: true,
className: 'z-10', className: 'z-10',
element element,
}).setLngLat(point.getCoordinates()); }).setLngLat(point.getCoordinates());
let anchor = { let anchor = {
@@ -159,7 +184,7 @@ export class RoutingControls {
trackIndex, trackIndex,
segmentIndex, segmentIndex,
marker, marker,
inZoom: false inZoom: false,
}; };
marker.on('dragstart', (e) => { marker.on('dragstart', (e) => {
@@ -187,7 +212,8 @@ export class RoutingControls {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
if (Date.now() - this.lastDragEvent < 100) { // Prevent click event during drag if (Date.now() - this.lastDragEvent < 100) {
// Prevent click event during drag
return; return;
} }
@@ -206,7 +232,12 @@ export class RoutingControls {
return false; return false;
} }
let segment = anchor.segment; let segment = anchor.segment;
if (distance(segment.trkpt[0].getCoordinates(), segment.trkpt[segment.trkpt.length - 1].getCoordinates()) > 1000) { if (
distance(
segment.trkpt[0].getCoordinates(),
segment.trkpt[segment.trkpt.length - 1].getCoordinates()
) > 1000
) {
return false; return false;
} }
return true; return true;
@@ -226,7 +257,8 @@ export class RoutingControls {
}; };
} }
toggleAnchorsForZoomLevelAndBounds() { // Show markers only if they are in the current zoom level and bounds toggleAnchorsForZoomLevelAndBounds() {
// Show markers only if they are in the current zoom level and bounds
this.shownAnchors.splice(0, this.shownAnchors.length); this.shownAnchors.splice(0, this.shownAnchors.length);
let center = this.map.getCenter(); let center = this.map.getCenter();
@@ -247,7 +279,8 @@ export class RoutingControls {
} }
showTemporaryAnchor(e: any) { showTemporaryAnchor(e: any) {
if (this.temporaryAnchor.marker.getElement().classList.contains('cursor-grabbing')) { // Do not not change the source point if it is already being dragged if (this.temporaryAnchor.marker.getElement().classList.contains('cursor-grabbing')) {
// Do not not change the source point if it is already being dragged
return; return;
} }
@@ -255,7 +288,15 @@ export class RoutingControls {
return; return;
} }
if (!get(selection).hasAnyParent(new ListTrackSegmentItem(this.fileId, e.features[0].properties.trackIndex, e.features[0].properties.segmentIndex))) { if (
!get(selection).hasAnyParent(
new ListTrackSegmentItem(
this.fileId,
e.features[0].properties.trackIndex,
e.features[0].properties.segmentIndex
)
)
) {
return; return;
} }
@@ -265,7 +306,7 @@ export class RoutingControls {
this.temporaryAnchor.point.setCoordinates({ this.temporaryAnchor.point.setCoordinates({
lat: e.lngLat.lat, lat: e.lngLat.lat,
lon: e.lngLat.lng lon: e.lngLat.lng,
}); });
this.temporaryAnchor.marker.setLngLat(e.lngLat).addTo(this.map); this.temporaryAnchor.marker.setLngLat(e.lngLat).addTo(this.map);
@@ -273,12 +314,17 @@ export class RoutingControls {
} }
updateTemporaryAnchor(e: any) { updateTemporaryAnchor(e: any) {
if (this.temporaryAnchor.marker.getElement().classList.contains('cursor-grabbing')) { // Do not hide if it is being dragged, and stop listening for mousemove if (this.temporaryAnchor.marker.getElement().classList.contains('cursor-grabbing')) {
// Do not hide if it is being dragged, and stop listening for mousemove
this.map.off('mousemove', this.updateTemporaryAnchorBinded); this.map.off('mousemove', this.updateTemporaryAnchorBinded);
return; return;
} }
if (e.point.dist(this.map.project(this.temporaryAnchor.point.getCoordinates())) > 20 || this.temporaryAnchorCloseToOtherAnchor(e)) { // Hide if too far from the layer if (
e.point.dist(this.map.project(this.temporaryAnchor.point.getCoordinates())) > 20 ||
this.temporaryAnchorCloseToOtherAnchor(e)
) {
// Hide if too far from the layer
this.temporaryAnchor.marker.remove(); this.temporaryAnchor.marker.remove();
this.map.off('mousemove', this.updateTemporaryAnchorBinded); this.map.off('mousemove', this.updateTemporaryAnchorBinded);
return; return;
@@ -296,14 +342,16 @@ export class RoutingControls {
return false; return false;
} }
async moveAnchor(anchorWithMarker: AnchorWithMarker) { // Move the anchor and update the route from and to the neighbouring anchors async moveAnchor(anchorWithMarker: AnchorWithMarker) {
// Move the anchor and update the route from and to the neighbouring anchors
let coordinates = { let coordinates = {
lat: anchorWithMarker.marker.getLngLat().lat, lat: anchorWithMarker.marker.getLngLat().lat,
lon: anchorWithMarker.marker.getLngLat().lng lon: anchorWithMarker.marker.getLngLat().lng,
}; };
let anchor = anchorWithMarker as Anchor; let anchor = anchorWithMarker as Anchor;
if (anchorWithMarker === this.temporaryAnchor) { // Temporary anchor, need to find the closest point of the segment and create an anchor for it if (anchorWithMarker === this.temporaryAnchor) {
// Temporary anchor, need to find the closest point of the segment and create an anchor for it
this.temporaryAnchor.marker.remove(); this.temporaryAnchor.marker.remove();
anchor = this.getPermanentAnchor(); anchor = this.getPermanentAnchor();
} }
@@ -328,7 +376,8 @@ export class RoutingControls {
let success = await this.routeBetweenAnchors(anchors, targetCoordinates); let success = await this.routeBetweenAnchors(anchors, targetCoordinates);
if (!success) { // Route failed, revert the anchor to the previous position if (!success) {
// Route failed, revert the anchor to the previous position
anchorWithMarker.marker.setLngLat(anchorWithMarker.point.getCoordinates()); anchorWithMarker.marker.setLngLat(anchorWithMarker.point.getCoordinates());
} }
} }
@@ -340,16 +389,24 @@ export class RoutingControls {
let minDetails: any = { distance: Number.MAX_VALUE }; let minDetails: any = { distance: Number.MAX_VALUE };
let minAnchor = this.temporaryAnchor as Anchor; let minAnchor = this.temporaryAnchor as Anchor;
file?.forEachSegment((segment, trackIndex, segmentIndex) => { file?.forEachSegment((segment, trackIndex, segmentIndex) => {
if (get(selection).hasAnyParent(new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex))) { if (
get(selection).hasAnyParent(
new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)
)
) {
let details: any = {}; let details: any = {};
let closest = getClosestLinePoint(segment.trkpt, this.temporaryAnchor.point, details); let closest = getClosestLinePoint(
segment.trkpt,
this.temporaryAnchor.point,
details
);
if (details.distance < minDetails.distance) { if (details.distance < minDetails.distance) {
minDetails = details; minDetails = details;
minAnchor = { minAnchor = {
point: closest, point: closest,
segment, segment,
trackIndex, trackIndex,
segmentIndex segmentIndex,
}; };
} }
} }
@@ -376,41 +433,67 @@ export class RoutingControls {
point: this.temporaryAnchor.point, point: this.temporaryAnchor.point,
trackIndex: -1, trackIndex: -1,
segmentIndex: -1, segmentIndex: -1,
trkptIndex: -1 trkptIndex: -1,
}; };
file?.forEachSegment((segment, trackIndex, segmentIndex) => { file?.forEachSegment((segment, trackIndex, segmentIndex) => {
if (get(selection).hasAnyParent(new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex))) { if (
get(selection).hasAnyParent(
new ListTrackSegmentItem(this.fileId, trackIndex, segmentIndex)
)
) {
let details: any = {}; let details: any = {};
getClosestLinePoint(segment.trkpt, this.temporaryAnchor.point, details); getClosestLinePoint(segment.trkpt, this.temporaryAnchor.point, details);
if (details.distance < minDetails.distance) { if (details.distance < minDetails.distance) {
minDetails = details; minDetails = details;
let before = details.before ? details.index : details.index - 1; let before = details.before ? details.index : details.index - 1;
let projectedPt = projectedPoint(segment.trkpt[before], segment.trkpt[before + 1], this.temporaryAnchor.point); let projectedPt = projectedPoint(
let ratio = distance(segment.trkpt[before], projectedPt) / distance(segment.trkpt[before], segment.trkpt[before + 1]); segment.trkpt[before],
segment.trkpt[before + 1],
this.temporaryAnchor.point
);
let ratio =
distance(segment.trkpt[before], projectedPt) /
distance(segment.trkpt[before], segment.trkpt[before + 1]);
let point = segment.trkpt[before].clone(); let point = segment.trkpt[before].clone();
point.setCoordinates(projectedPt); point.setCoordinates(projectedPt);
point.ele = (1 - ratio) * (segment.trkpt[before].ele ?? 0) + ratio * (segment.trkpt[before + 1].ele ?? 0); point.ele =
point.time = (segment.trkpt[before].time && segment.trkpt[before + 1].time) ? new Date((1 - ratio) * segment.trkpt[before].time.getTime() + ratio * segment.trkpt[before + 1].time.getTime()) : undefined; (1 - ratio) * (segment.trkpt[before].ele ?? 0) +
ratio * (segment.trkpt[before + 1].ele ?? 0);
point.time =
segment.trkpt[before].time && segment.trkpt[before + 1].time
? new Date(
(1 - ratio) * segment.trkpt[before].time.getTime() +
ratio * segment.trkpt[before + 1].time.getTime()
)
: undefined;
point._data = { point._data = {
anchor: true, anchor: true,
zoom: 0 zoom: 0,
}; };
minInfo = { minInfo = {
point, point,
trackIndex, trackIndex,
segmentIndex, segmentIndex,
trkptIndex: before + 1 trkptIndex: before + 1,
}; };
} }
} }
}); });
if (minInfo.trackIndex !== -1) { if (minInfo.trackIndex !== -1) {
dbUtils.applyToFile(this.fileId, (file) => file.replaceTrackPoints(minInfo.trackIndex, minInfo.segmentIndex, minInfo.trkptIndex, minInfo.trkptIndex - 1, [minInfo.point])); dbUtils.applyToFile(this.fileId, (file) =>
file.replaceTrackPoints(
minInfo.trackIndex,
minInfo.segmentIndex,
minInfo.trkptIndex,
minInfo.trkptIndex - 1,
[minInfo.point]
)
);
} }
} }
@@ -418,22 +501,46 @@ export class RoutingControls {
return () => this.deleteAnchor(anchor); return () => this.deleteAnchor(anchor);
} }
async deleteAnchor(anchor: Anchor) { // Remove the anchor and route between the neighbouring anchors if they exist async deleteAnchor(anchor: Anchor) {
// Remove the anchor and route between the neighbouring anchors if they exist
this.popup.remove(); this.popup.remove();
let [previousAnchor, nextAnchor] = this.getNeighbouringAnchors(anchor); let [previousAnchor, nextAnchor] = this.getNeighbouringAnchors(anchor);
if (previousAnchor === null && nextAnchor === null) { // Only one point, remove it if (previousAnchor === null && nextAnchor === null) {
dbUtils.applyToFile(this.fileId, (file) => file.replaceTrackPoints(anchor.trackIndex, anchor.segmentIndex, 0, 0, [])); // Only one point, remove it
} else if (previousAnchor === null) { // First point, remove trackpoints until nextAnchor dbUtils.applyToFile(this.fileId, (file) =>
dbUtils.applyToFile(this.fileId, (file) => file.replaceTrackPoints(anchor.trackIndex, anchor.segmentIndex, 0, nextAnchor.point._data.index - 1, [])); file.replaceTrackPoints(anchor.trackIndex, anchor.segmentIndex, 0, 0, [])
} else if (nextAnchor === null) { // Last point, remove trackpoints from previousAnchor );
} else if (previousAnchor === null) {
// First point, remove trackpoints until nextAnchor
dbUtils.applyToFile(this.fileId, (file) =>
file.replaceTrackPoints(
anchor.trackIndex,
anchor.segmentIndex,
0,
nextAnchor.point._data.index - 1,
[]
)
);
} else if (nextAnchor === null) {
// Last point, remove trackpoints from previousAnchor
dbUtils.applyToFile(this.fileId, (file) => { dbUtils.applyToFile(this.fileId, (file) => {
let segment = file.getSegment(anchor.trackIndex, anchor.segmentIndex); let segment = file.getSegment(anchor.trackIndex, anchor.segmentIndex);
file.replaceTrackPoints(anchor.trackIndex, anchor.segmentIndex, previousAnchor.point._data.index + 1, segment.trkpt.length - 1, []); file.replaceTrackPoints(
anchor.trackIndex,
anchor.segmentIndex,
previousAnchor.point._data.index + 1,
segment.trkpt.length - 1,
[]
);
}); });
} else { // Route between previousAnchor and nextAnchor } else {
this.routeBetweenAnchors([previousAnchor, nextAnchor], [previousAnchor.point.getCoordinates(), nextAnchor.point.getCoordinates()]); // Route between previousAnchor and nextAnchor
this.routeBetweenAnchors(
[previousAnchor, nextAnchor],
[previousAnchor.point.getCoordinates(), nextAnchor.point.getCoordinates()]
);
} }
} }
@@ -449,27 +556,43 @@ export class RoutingControls {
return; return;
} }
let speed = fileWithStats.statistics.getStatisticsFor(new ListTrackSegmentItem(this.fileId, anchor.trackIndex, anchor.segmentIndex)).global.speed.moving; let speed = fileWithStats.statistics.getStatisticsFor(
new ListTrackSegmentItem(this.fileId, anchor.trackIndex, anchor.segmentIndex)
).global.speed.moving;
let segment = anchor.segment; let segment = anchor.segment;
dbUtils.applyToFile(this.fileId, (file) => { dbUtils.applyToFile(this.fileId, (file) => {
file.replaceTrackPoints(anchor.trackIndex, anchor.segmentIndex, segment.trkpt.length, segment.trkpt.length - 1, segment.trkpt.slice(0, anchor.point._data.index), speed > 0 ? speed : undefined); file.replaceTrackPoints(
file.crop(anchor.point._data.index, anchor.point._data.index + segment.trkpt.length - 1, [anchor.trackIndex], [anchor.segmentIndex]); anchor.trackIndex,
anchor.segmentIndex,
segment.trkpt.length,
segment.trkpt.length - 1,
segment.trkpt.slice(0, anchor.point._data.index),
speed > 0 ? speed : undefined
);
file.crop(
anchor.point._data.index,
anchor.point._data.index + segment.trkpt.length - 1,
[anchor.trackIndex],
[anchor.segmentIndex]
);
}); });
} }
async appendAnchor(e: mapboxgl.MapMouseEvent) { // Add a new anchor to the end of the last segment async appendAnchor(e: mapboxgl.MapMouseEvent) {
// Add a new anchor to the end of the last segment
if (get(streetViewEnabled) && get(streetViewSource) === 'google') { if (get(streetViewEnabled) && get(streetViewSource) === 'google') {
return; return;
} }
this.appendAnchorWithCoordinates({ this.appendAnchorWithCoordinates({
lat: e.lngLat.lat, lat: e.lngLat.lat,
lon: e.lngLat.lng lon: e.lngLat.lng,
}); });
} }
async appendAnchorWithCoordinates(coordinates: Coordinates) { // Add a new anchor to the end of the last segment async appendAnchorWithCoordinates(coordinates: Coordinates) {
// Add a new anchor to the end of the last segment
let selected = getOrderedSelection(); let selected = getOrderedSelection();
if (selected.length === 0 || selected[selected.length - 1].getFileId() !== this.fileId) { if (selected.length === 0 || selected[selected.length - 1].getFileId() !== this.fileId) {
return; return;
@@ -479,7 +602,7 @@ export class RoutingControls {
let lastAnchor = this.anchors[this.anchors.length - 1]; let lastAnchor = this.anchors[this.anchors.length - 1];
let newPoint = new TrackPoint({ let newPoint = new TrackPoint({
attributes: coordinates attributes: coordinates,
}); });
newPoint._data.anchor = true; newPoint._data.anchor = true;
newPoint._data.zoom = 0; newPoint._data.zoom = 0;
@@ -490,7 +613,10 @@ export class RoutingControls {
if (item instanceof ListTrackItem || item instanceof ListTrackSegmentItem) { if (item instanceof ListTrackItem || item instanceof ListTrackSegmentItem) {
trackIndex = item.getTrackIndex(); trackIndex = item.getTrackIndex();
} }
let segmentIndex = (file.trk.length > 0 && file.trk[trackIndex].trkseg.length > 0) ? file.trk[trackIndex].trkseg.length - 1 : 0; let segmentIndex =
file.trk.length > 0 && file.trk[trackIndex].trkseg.length > 0
? file.trk[trackIndex].trkseg.length - 1
: 0;
if (item instanceof ListTrackSegmentItem) { if (item instanceof ListTrackSegmentItem) {
segmentIndex = item.getSegmentIndex(); segmentIndex = item.getSegmentIndex();
} }
@@ -514,10 +640,13 @@ export class RoutingControls {
point: newPoint, point: newPoint,
segment: lastAnchor.segment, segment: lastAnchor.segment,
trackIndex: lastAnchor.trackIndex, trackIndex: lastAnchor.trackIndex,
segmentIndex: lastAnchor.segmentIndex segmentIndex: lastAnchor.segmentIndex,
}; };
await this.routeBetweenAnchors([lastAnchor, newAnchor], [lastAnchor.point.getCoordinates(), newAnchor.point.getCoordinates()]); await this.routeBetweenAnchors(
[lastAnchor, newAnchor],
[lastAnchor.point.getCoordinates(), newAnchor.point.getCoordinates()]
);
} }
getNeighbouringAnchors(anchor: Anchor): [Anchor | null, Anchor | null] { getNeighbouringAnchors(anchor: Anchor): [Anchor | null, Anchor | null] {
@@ -527,11 +656,17 @@ export class RoutingControls {
for (let i = 0; i < this.anchors.length; i++) { for (let i = 0; i < this.anchors.length; i++) {
if (this.anchors[i].segment === anchor.segment && this.anchors[i].inZoom) { if (this.anchors[i].segment === anchor.segment && this.anchors[i].inZoom) {
if (this.anchors[i].point._data.index < anchor.point._data.index) { if (this.anchors[i].point._data.index < anchor.point._data.index) {
if (!previousAnchor || this.anchors[i].point._data.index > previousAnchor.point._data.index) { if (
!previousAnchor ||
this.anchors[i].point._data.index > previousAnchor.point._data.index
) {
previousAnchor = this.anchors[i]; previousAnchor = this.anchors[i];
} }
} else if (this.anchors[i].point._data.index > anchor.point._data.index) { } else if (this.anchors[i].point._data.index > anchor.point._data.index) {
if (!nextAnchor || this.anchors[i].point._data.index < nextAnchor.point._data.index) { if (
!nextAnchor ||
this.anchors[i].point._data.index < nextAnchor.point._data.index
) {
nextAnchor = this.anchors[i]; nextAnchor = this.anchors[i];
} }
} }
@@ -541,7 +676,10 @@ export class RoutingControls {
return [previousAnchor, nextAnchor]; return [previousAnchor, nextAnchor];
} }
async routeBetweenAnchors(anchors: Anchor[], targetCoordinates: Coordinates[]): Promise<boolean> { async routeBetweenAnchors(
anchors: Anchor[],
targetCoordinates: Coordinates[]
): Promise<boolean> {
let segment = anchors[0].segment; let segment = anchors[0].segment;
let fileWithStats = get(this.file); let fileWithStats = get(this.file);
@@ -549,10 +687,15 @@ export class RoutingControls {
return false; return false;
} }
if (anchors.length === 1) { // Only one anchor, update the point in the segment if (anchors.length === 1) {
dbUtils.applyToFile(this.fileId, (file) => file.replaceTrackPoints(anchors[0].trackIndex, anchors[0].segmentIndex, 0, 0, [new TrackPoint({ // Only one anchor, update the point in the segment
dbUtils.applyToFile(this.fileId, (file) =>
file.replaceTrackPoints(anchors[0].trackIndex, anchors[0].segmentIndex, 0, 0, [
new TrackPoint({
attributes: targetCoordinates[0], attributes: targetCoordinates[0],
})])); }),
])
);
return true; return true;
} }
@@ -561,25 +704,28 @@ export class RoutingControls {
response = await route(targetCoordinates); response = await route(targetCoordinates);
} catch (e: any) { } catch (e: any) {
if (e.message.includes('from-position not mapped in existing datafile')) { if (e.message.includes('from-position not mapped in existing datafile')) {
toast.error(get(_)("toolbar.routing.error.from")); toast.error(get(_)('toolbar.routing.error.from'));
} else if (e.message.includes('via1-position not mapped in existing datafile')) { } else if (e.message.includes('via1-position not mapped in existing datafile')) {
toast.error(get(_)("toolbar.routing.error.via")); toast.error(get(_)('toolbar.routing.error.via'));
} else if (e.message.includes('to-position not mapped in existing datafile')) { } else if (e.message.includes('to-position not mapped in existing datafile')) {
toast.error(get(_)("toolbar.routing.error.to")); toast.error(get(_)('toolbar.routing.error.to'));
} else if (e.message.includes('Time-out')) { } else if (e.message.includes('Time-out')) {
toast.error(get(_)("toolbar.routing.error.timeout")); toast.error(get(_)('toolbar.routing.error.timeout'));
} else { } else {
toast.error(e.message); toast.error(e.message);
} }
return false; return false;
} }
if (anchors[0].point._data.index === 0) { // First anchor is the first point of the segment if (anchors[0].point._data.index === 0) {
response[0].time = anchors[0].point.time; // First anchor is the first point of the segment
anchors[0].point = response[0]; // replace the first anchor anchors[0].point = response[0]; // replace the first anchor
anchors[0].point._data.index = 0; anchors[0].point._data.index = 0;
} else if (anchors[0].point._data.index === segment.trkpt.length - 1 && distance(anchors[0].point.getCoordinates(), response[0].getCoordinates()) < 1) { // First anchor is the last point of the segment, and the new point is close enough } else if (
response[0].time = anchors[0].point.time; anchors[0].point._data.index === segment.trkpt.length - 1 &&
distance(anchors[0].point.getCoordinates(), response[0].getCoordinates()) < 1
) {
// First anchor is the last point of the segment, and the new point is close enough
anchors[0].point = response[0]; // replace the first anchor anchors[0].point = response[0]; // replace the first anchor
anchors[0].point._data.index = segment.trkpt.length - 1; anchors[0].point._data.index = segment.trkpt.length - 1;
} else { } else {
@@ -587,8 +733,8 @@ export class RoutingControls {
response.splice(0, 0, anchors[0].point); // Insert it in the response to keep it response.splice(0, 0, anchors[0].point); // Insert it in the response to keep it
} }
if (anchors[anchors.length - 1].point._data.index === segment.trkpt.length - 1) { // Last anchor is the last point of the segment if (anchors[anchors.length - 1].point._data.index === segment.trkpt.length - 1) {
response[response.length - 1].time = anchors[anchors.length - 1].point.time; // Last anchor is the last point of the segment
anchors[anchors.length - 1].point = response[response.length - 1]; // replace the last anchor anchors[anchors.length - 1].point = response[response.length - 1]; // replace the last anchor
anchors[anchors.length - 1].point._data.index = segment.trkpt.length - 1; anchors[anchors.length - 1].point._data.index = segment.trkpt.length - 1;
} else { } else {
@@ -599,7 +745,7 @@ export class RoutingControls {
for (let i = 1; i < anchors.length - 1; i++) { for (let i = 1; i < anchors.length - 1; i++) {
// Find the closest point to the intermediate anchor // Find the closest point to the intermediate anchor
// and transfer the marker to that point // and transfer the marker to that point
anchors[i].point = getClosestLinePoint(response.slice(1, - 1), targetCoordinates[i]); anchors[i].point = getClosestLinePoint(response.slice(1, -1), targetCoordinates[i]);
} }
anchors.forEach((anchor) => { anchors.forEach((anchor) => {
@@ -607,95 +753,68 @@ export class RoutingControls {
anchor.point._data.zoom = 0; // Make these anchors permanent anchor.point._data.zoom = 0; // Make these anchors permanent
}); });
let stats = fileWithStats.statistics.getStatisticsFor(new ListTrackSegmentItem(this.fileId, anchors[0].trackIndex, anchors[0].segmentIndex)); let stats = fileWithStats.statistics.getStatisticsFor(
new ListTrackSegmentItem(this.fileId, anchors[0].trackIndex, anchors[0].segmentIndex)
);
let speed: number | undefined = undefined; let speed: number | undefined = undefined;
let startTime = anchors[0].point.time; let startTime = anchors[0].point.time;
if (stats.global.speed.moving > 0) { if (stats.global.speed.moving > 0) {
let replacingTime = 0;
if (get(timestampsMode) === TimestampsMode.PRESERVE_TIMESTAMPS) {
this.extendResponseToContiguousAdaptedTimePoints(segment, anchors, response);
response.forEach((point) => point.time = undefined);
startTime = anchors[0].point.time;
replacingTime = stats.local.time.total[anchors[anchors.length - 1].point._data.index] - stats.local.time.total[anchors[0].point._data.index];
if (replacingTime > 0) {
for (let i = 1; i < anchors.length - 1; i++) {
anchors[i].point._data['adapted_time'] = true;
}
}
}
let replacingDistance = 0; let replacingDistance = 0;
for (let i = 1; i < response.length; i++) { for (let i = 1; i < response.length; i++) {
replacingDistance += distance(response[i - 1].getCoordinates(), response[i].getCoordinates()) / 1000; replacingDistance +=
distance(response[i - 1].getCoordinates(), response[i].getCoordinates()) / 1000;
} }
let replacedDistance =
if (get(timestampsMode) === TimestampsMode.PRESERVE_AVERAGE_SPEED || replacingTime === 0) { stats.local.distance.moving[anchors[anchors.length - 1].point._data.index] -
let replacedDistance = stats.local.distance.moving[anchors[anchors.length - 1].point._data.index] - stats.local.distance.moving[anchors[0].point._data.index]; stats.local.distance.moving[anchors[0].point._data.index];
let newDistance = stats.global.distance.moving + replacingDistance - replacedDistance; let newDistance = stats.global.distance.moving + replacingDistance - replacedDistance;
let newTime = newDistance / stats.global.speed.moving * 3600; let newTime = (newDistance / stats.global.speed.moving) * 3600;
let remainingTime = stats.global.time.moving - (stats.local.time.moving[anchors[anchors.length - 1].point._data.index] - stats.local.time.moving[anchors[0].point._data.index]); let remainingTime =
replacingTime = newTime - remainingTime; stats.global.time.moving -
(stats.local.time.moving[anchors[anchors.length - 1].point._data.index] -
stats.local.time.moving[anchors[0].point._data.index]);
let replacingTime = newTime - remainingTime;
if (replacingTime <= 0) { // Fallback to simple time difference if (replacingTime <= 0) {
replacingTime = stats.local.time.total[anchors[anchors.length - 1].point._data.index] - stats.local.time.total[anchors[0].point._data.index]; // Fallback to simple time difference
} replacingTime =
stats.local.time.total[anchors[anchors.length - 1].point._data.index] -
stats.local.time.total[anchors[0].point._data.index];
} }
speed = replacingDistance / replacingTime * 3600; speed = (replacingDistance / replacingTime) * 3600;
if (startTime === undefined) { // Replacing the first point if (startTime === undefined) {
// Replacing the first point
let endIndex = anchors[anchors.length - 1].point._data.index; let endIndex = anchors[anchors.length - 1].point._data.index;
startTime = new Date((segment.trkpt[endIndex].time?.getTime() ?? 0) - (replacingTime + stats.local.time.total[endIndex] - stats.local.time.moving[endIndex]) * 1000); startTime = new Date(
(segment.trkpt[endIndex].time?.getTime() ?? 0) -
(replacingTime +
stats.local.time.total[endIndex] -
stats.local.time.moving[endIndex]) *
1000
);
} }
} }
dbUtils.applyToFile(this.fileId, (file) => file.replaceTrackPoints(anchors[0].trackIndex, anchors[0].segmentIndex, anchors[0].point._data.index, anchors[anchors.length - 1].point._data.index, response, speed, startTime)); dbUtils.applyToFile(this.fileId, (file) =>
file.replaceTrackPoints(
anchors[0].trackIndex,
anchors[0].segmentIndex,
anchors[0].point._data.index,
anchors[anchors.length - 1].point._data.index,
response,
speed,
startTime
)
);
return true; return true;
} }
extendResponseToContiguousAdaptedTimePoints(segment: TrackSegment, anchors: Anchor[], response: TrackPoint[]) {
while (anchors[0].point._data.adapted_time) {
let previousAnchor = null;
for (let i = 0; i < this.anchors.length; i++) {
if (this.anchors[i].point._data.index < anchors[0].point._data.index) {
previousAnchor = this.anchors[i];
} else {
break;
}
}
if (previousAnchor === null) {
break;
} else {
response.splice(0, 0, ...segment.trkpt.slice(previousAnchor.point._data.index, anchors[0].point._data.index).map((point) => point.clone()));
anchors.splice(0, 0, previousAnchor);
}
}
while (anchors[anchors.length - 1].point._data.adapted_time) {
let nextAnchor = null;
for (let i = this.anchors.length - 1; i >= 0; i--) {
if (this.anchors[i].point._data.index > anchors[anchors.length - 1].point._data.index) {
nextAnchor = this.anchors[i];
} else {
break;
}
}
if (nextAnchor === null) {
break;
} else {
response.push(...segment.trkpt.slice(anchors[anchors.length - 1].point._data.index + 1, nextAnchor.point._data.index + 1).map((point) => point.clone()));
anchors.push(nextAnchor);
}
}
}
destroy() { destroy() {
this.remove(); this.remove();
this.unsubscribes.forEach((unsubscribe) => unsubscribe()); this.unsubscribes.forEach((unsubscribe) => unsubscribe());

View File

@@ -1,4 +1,4 @@
import { ramerDouglasPeucker, type GPXFile, type TrackSegment } from "gpx"; import { ramerDouglasPeucker, type GPXFile, type TrackSegment } from 'gpx';
const earthRadius = 6371008.8; const earthRadius = 6371008.8;
@@ -17,7 +17,8 @@ export function updateAnchorPoints(file: GPXFile) {
let segments = file.getSegments(); let segments = file.getSegments();
for (let segment of segments) { for (let segment of segments) {
if (!segment._data.anchors) { // New segment, compute anchor points for it if (!segment._data.anchors) {
// New segment, compute anchor points for it
computeAnchorPoints(segment); computeAnchorPoints(segment);
continue; continue;
} }
@@ -42,4 +43,3 @@ function computeAnchorPoints(segment: TrackSegment) {
}); });
segment._data.anchors = true; segment._data.anchors = true;
} }

View File

@@ -2,7 +2,7 @@
export enum SplitType { export enum SplitType {
FILES = 'files', FILES = 'files',
TRACKS = 'tracks', TRACKS = 'tracks',
SEGMENTS = 'segments' SEGMENTS = 'segments',
} }
</script> </script>
@@ -50,7 +50,7 @@
$slicedGPXStatistics = [ $slicedGPXStatistics = [
get(gpxStatistics).slice(sliderValues[0], sliderValues[1]), get(gpxStatistics).slice(sliderValues[0], sliderValues[1]),
sliderValues[0], sliderValues[0],
sliderValues[1] sliderValues[1],
]; ];
} else { } else {
$slicedGPXStatistics = undefined; $slicedGPXStatistics = undefined;
@@ -93,10 +93,10 @@
const splitTypes = [ const splitTypes = [
{ value: SplitType.FILES, label: $_('gpx.files') }, { value: SplitType.FILES, label: $_('gpx.files') },
{ value: SplitType.TRACKS, label: $_('gpx.tracks') }, { value: SplitType.TRACKS, label: $_('gpx.tracks') },
{ value: SplitType.SEGMENTS, label: $_('gpx.segments') } { value: SplitType.SEGMENTS, label: $_('gpx.segments') },
]; ];
let splitType = splitTypes[0]; let splitType = splitTypes.find((type) => type.value === $splitAs) ?? splitTypes[0];
$: splitAs.set(splitType.value); $: splitAs.set(splitType.value);
@@ -111,7 +111,12 @@
<div class="flex flex-col gap-3 w-full max-w-80 {$$props.class ?? ''}"> <div class="flex flex-col gap-3 w-full max-w-80 {$$props.class ?? ''}">
<div class="p-2"> <div class="p-2">
<Slider bind:value={sliderValues} max={maxSliderValue} step={1} disabled={!validSelection} /> <Slider
bind:value={sliderValues}
max={maxSliderValue}
step={1}
disabled={!validSelection}
/>
</div> </div>
<Button <Button
variant="outline" variant="outline"

View File

@@ -1,12 +1,15 @@
import { TrackPoint, TrackSegment } from "gpx"; import { TrackPoint, TrackSegment } from 'gpx';
import { get } from "svelte/store"; import { get } from 'svelte/store';
import mapboxgl from "mapbox-gl"; import mapboxgl from 'mapbox-gl';
import { dbUtils, getFile } from "$lib/db"; import { dbUtils, getFile } from '$lib/db';
import { applyToOrderedSelectedItemsFromFile, selection } from "$lib/components/file-list/Selection"; import {
import { ListTrackSegmentItem } from "$lib/components/file-list/FileList"; applyToOrderedSelectedItemsFromFile,
import { currentTool, gpxStatistics, Tool } from "$lib/stores"; selection,
import { _ } from "svelte-i18n"; } from '$lib/components/file-list/Selection';
import { Scissors } from "lucide-static"; import { ListTrackSegmentItem } from '$lib/components/file-list/FileList';
import { currentTool, gpxStatistics, Tool } from '$lib/stores';
import { _ } from 'svelte-i18n';
import { Scissors } from 'lucide-static';
export class SplitControls { export class SplitControls {
active: boolean = false; active: boolean = false;
@@ -15,7 +18,8 @@ export class SplitControls {
shownControls: ControlWithMarker[] = []; shownControls: ControlWithMarker[] = [];
unsubscribes: Function[] = []; unsubscribes: Function[] = [];
toggleControlsForZoomLevelAndBoundsBinded: () => void = this.toggleControlsForZoomLevelAndBounds.bind(this); toggleControlsForZoomLevelAndBoundsBinded: () => void =
this.toggleControlsForZoomLevelAndBounds.bind(this);
constructor(map: mapboxgl.Map) { constructor(map: mapboxgl.Map) {
this.map = map; this.map = map;
@@ -48,15 +52,21 @@ export class SplitControls {
this.map.on('move', this.toggleControlsForZoomLevelAndBoundsBinded); this.map.on('move', this.toggleControlsForZoomLevelAndBoundsBinded);
} }
updateControls() { // Update the markers when the files change updateControls() {
// Update the markers when the files change
let controlIndex = 0; let controlIndex = 0;
applyToOrderedSelectedItemsFromFile((fileId, level, items) => { applyToOrderedSelectedItemsFromFile((fileId, level, items) => {
let file = getFile(fileId); let file = getFile(fileId);
if (file) { if (file) {
file.forEachSegment((segment, trackIndex, segmentIndex) => { file.forEachSegment((segment, trackIndex, segmentIndex) => {
if (get(selection).hasAnyParent(new ListTrackSegmentItem(fileId, trackIndex, segmentIndex))) { if (
for (let point of segment.trkpt.slice(1, -1)) { // Update the existing controls (could be improved by matching the existing controls with the new ones?) get(selection).hasAnyParent(
new ListTrackSegmentItem(fileId, trackIndex, segmentIndex)
)
) {
for (let point of segment.trkpt.slice(1, -1)) {
// Update the existing controls (could be improved by matching the existing controls with the new ones?)
if (point._data.anchor) { if (point._data.anchor) {
if (controlIndex < this.controls.length) { if (controlIndex < this.controls.length) {
this.controls[controlIndex].fileId = fileId; this.controls[controlIndex].fileId = fileId;
@@ -64,20 +74,30 @@ export class SplitControls {
this.controls[controlIndex].segment = segment; this.controls[controlIndex].segment = segment;
this.controls[controlIndex].trackIndex = trackIndex; this.controls[controlIndex].trackIndex = trackIndex;
this.controls[controlIndex].segmentIndex = segmentIndex; this.controls[controlIndex].segmentIndex = segmentIndex;
this.controls[controlIndex].marker.setLngLat(point.getCoordinates()); this.controls[controlIndex].marker.setLngLat(
point.getCoordinates()
);
} else { } else {
this.controls.push(this.createControl(point, segment, fileId, trackIndex, segmentIndex)); this.controls.push(
this.createControl(
point,
segment,
fileId,
trackIndex,
segmentIndex
)
);
} }
controlIndex++; controlIndex++;
} }
} }
} }
}); });
} }
}, false); }, false);
while (controlIndex < this.controls.length) { // Remove the extra controls while (controlIndex < this.controls.length) {
// Remove the extra controls
this.controls.pop()?.marker.remove(); this.controls.pop()?.marker.remove();
} }
@@ -94,7 +114,8 @@ export class SplitControls {
this.map.off('move', this.toggleControlsForZoomLevelAndBoundsBinded); this.map.off('move', this.toggleControlsForZoomLevelAndBoundsBinded);
} }
toggleControlsForZoomLevelAndBounds() { // Show markers only if they are in the current zoom level and bounds toggleControlsForZoomLevelAndBounds() {
// Show markers only if they are in the current zoom level and bounds
this.shownControls.splice(0, this.shownControls.length); this.shownControls.splice(0, this.shownControls.length);
let southWest = this.map.unproject([0, this.map.getCanvas().height]); let southWest = this.map.unproject([0, this.map.getCanvas().height]);
@@ -113,15 +134,23 @@ export class SplitControls {
}); });
} }
createControl(point: TrackPoint, segment: TrackSegment, fileId: string, trackIndex: number, segmentIndex: number): ControlWithMarker { createControl(
point: TrackPoint,
segment: TrackSegment,
fileId: string,
trackIndex: number,
segmentIndex: number
): ControlWithMarker {
let element = document.createElement('div'); let element = document.createElement('div');
element.className = `h-6 w-6 p-0.5 rounded-full bg-white border-2 border-black cursor-pointer`; element.className = `h-6 w-6 p-0.5 rounded-full bg-white border-2 border-black cursor-pointer`;
element.innerHTML = Scissors.replace('width="24"', "").replace('height="24"', "").replace('stroke="currentColor"', 'stroke="black"'); element.innerHTML = Scissors.replace('width="24"', '')
.replace('height="24"', '')
.replace('stroke="currentColor"', 'stroke="black"');
let marker = new mapboxgl.Marker({ let marker = new mapboxgl.Marker({
draggable: true, draggable: true,
className: 'z-10', className: 'z-10',
element element,
}).setLngLat(point.getCoordinates()); }).setLngLat(point.getCoordinates());
let control = { let control = {
@@ -131,12 +160,18 @@ export class SplitControls {
trackIndex, trackIndex,
segmentIndex, segmentIndex,
marker, marker,
inZoom: false inZoom: false,
}; };
marker.getElement().addEventListener('click', (e) => { marker.getElement().addEventListener('click', (e) => {
e.stopPropagation(); e.stopPropagation();
dbUtils.split(control.fileId, control.trackIndex, control.segmentIndex, control.point.getCoordinates(), control.point._data.index); dbUtils.split(
control.fileId,
control.trackIndex,
control.segmentIndex,
control.point.getCoordinates(),
control.point._data.index
);
}); });
return control; return control;

View File

@@ -1,32 +1,83 @@
import Dexie, { liveQuery } from 'dexie'; import Dexie, { liveQuery } from 'dexie';
import { GPXFile, GPXStatistics, Track, TrackSegment, Waypoint, TrackPoint, type Coordinates, distance, type LineStyleExtension, type WaypointType } from 'gpx'; import {
import { enableMapSet, enablePatches, applyPatches, type Patch, type WritableDraft, freeze, produceWithPatches } from 'immer'; GPXFile,
GPXStatistics,
Track,
TrackSegment,
Waypoint,
TrackPoint,
type Coordinates,
distance,
type LineStyleExtension,
type WaypointType,
} from 'gpx';
import {
enableMapSet,
enablePatches,
applyPatches,
type Patch,
type WritableDraft,
freeze,
produceWithPatches,
} from 'immer';
import { writable, get, derived, type Readable, type Writable } from 'svelte/store'; import { writable, get, derived, type Readable, type Writable } from 'svelte/store';
import { gpxStatistics, initTargetMapBounds, map, splitAs, updateAllHidden, updateTargetMapBounds } from './stores'; import {
import { defaultBasemap, defaultBasemapTree, defaultOverlayTree, defaultOverlays, type CustomLayer, defaultOpacities, defaultOverpassQueries, defaultOverpassTree } from './assets/layers'; gpxStatistics,
import { applyToOrderedItemsFromFile, applyToOrderedSelectedItemsFromFile, selection } from '$lib/components/file-list/Selection'; initTargetMapBounds,
import { ListFileItem, ListItem, ListTrackItem, ListLevel, ListTrackSegmentItem, ListWaypointItem, ListRootItem } from '$lib/components/file-list/FileList'; map,
splitAs,
updateAllHidden,
updateTargetMapBounds,
} from './stores';
import {
defaultBasemap,
defaultBasemapTree,
defaultOverlayTree,
defaultOverlays,
type CustomLayer,
defaultOpacities,
defaultOverpassQueries,
defaultOverpassTree,
} from './assets/layers';
import {
applyToOrderedItemsFromFile,
applyToOrderedSelectedItemsFromFile,
selection,
} from '$lib/components/file-list/Selection';
import {
ListFileItem,
ListItem,
ListTrackItem,
ListLevel,
ListTrackSegmentItem,
ListWaypointItem,
ListRootItem,
} from '$lib/components/file-list/FileList';
import { updateAnchorPoints } from '$lib/components/toolbar/tools/routing/Simplify'; import { updateAnchorPoints } from '$lib/components/toolbar/tools/routing/Simplify';
import { SplitType } from '$lib/components/toolbar/tools/scissors/Scissors.svelte'; import { SplitType } from '$lib/components/toolbar/tools/scissors/Scissors.svelte';
import { getClosestLinePoint, getElevation } from '$lib/utils'; import { getClosestLinePoint, getElevation } from '$lib/utils';
import { TimestampsMode } from '$lib/types';
import { browser } from '$app/environment'; import { browser } from '$app/environment';
enableMapSet(); enableMapSet();
enablePatches(); enablePatches();
class Database extends Dexie { class Database extends Dexie {
fileids!: Dexie.Table<string, string>; fileids!: Dexie.Table<string, string>;
files!: Dexie.Table<GPXFile, string>; files!: Dexie.Table<GPXFile, string>;
patches!: Dexie.Table<{ patch: Patch[], inversePatch: Patch[], index: number }, number>; patches!: Dexie.Table<{ patch: Patch[]; inversePatch: Patch[]; index: number }, number>;
settings!: Dexie.Table<any, string>; settings!: Dexie.Table<any, string>;
overpasstiles!: Dexie.Table<{ query: string, x: number, y: number, time: number }, [string, number, number]>; overpasstiles!: Dexie.Table<
overpassdata!: Dexie.Table<{ query: string, id: number, poi: GeoJSON.Feature }, [string, number]>; { query: string; x: number; y: number; time: number },
[string, number, number]
>;
overpassdata!: Dexie.Table<
{ query: string; id: number; poi: GeoJSON.Feature },
[string, number]
>;
constructor() { constructor() {
super("Database", { super('Database', {
cache: 'immutable' cache: 'immutable',
}); });
this.version(1).stores({ this.version(1).stores({
fileids: ',&fileid', fileids: ',&fileid',
@@ -42,10 +93,15 @@ class Database extends Dexie {
export const db = new Database(); export const db = new Database();
// Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber, and updates to the store are pushed to the DB // Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber, and updates to the store are pushed to the DB
export function bidirectionalDexieStore<K, V>(table: Dexie.Table<V, K>, key: K, initial: V, initialize: boolean = true): Writable<V | undefined> { export function bidirectionalDexieStore<K, V>(
table: Dexie.Table<V, K>,
key: K,
initial: V,
initialize: boolean = true
): Writable<V | undefined> {
let first = true; let first = true;
let store = writable<V | undefined>(initialize ? initial : undefined); let store = writable<V | undefined>(initialize ? initial : undefined);
liveQuery(() => table.get(key)).subscribe(value => { liveQuery(() => table.get(key)).subscribe((value) => {
if (value === undefined) { if (value === undefined) {
if (first) { if (first) {
if (!initialize) { if (!initialize) {
@@ -71,11 +127,15 @@ export function bidirectionalDexieStore<K, V>(table: Dexie.Table<V, K>, key: K,
if (typeof newValue === 'object' || newValue !== get(store)) { if (typeof newValue === 'object' || newValue !== get(store)) {
table.put(newValue, key); table.put(newValue, key);
} }
} },
}; };
} }
export function dexieSettingStore<T>(key: string, initial: T, initialize: boolean = true): Writable<T> { export function dexieSettingStore<T>(
key: string,
initial: T,
initialize: boolean = true
): Writable<T> {
return bidirectionalDexieStore(db.settings, key, initial, initialize); return bidirectionalDexieStore(db.settings, key, initial, initialize);
} }
@@ -86,19 +146,22 @@ export const settings = {
elevationProfile: dexieSettingStore('elevationProfile', true), elevationProfile: dexieSettingStore('elevationProfile', true),
additionalDatasets: dexieSettingStore<string[]>('additionalDatasets', []), additionalDatasets: dexieSettingStore<string[]>('additionalDatasets', []),
elevationFill: dexieSettingStore<'slope' | 'surface' | undefined>('elevationFill', undefined), elevationFill: dexieSettingStore<'slope' | 'surface' | undefined>('elevationFill', undefined),
verticalFileView: dexieSettingStore<boolean>('fileView', false), treeFileView: dexieSettingStore<boolean>('fileView', false),
minimizeRoutingMenu: dexieSettingStore('minimizeRoutingMenu', false), minimizeRoutingMenu: dexieSettingStore('minimizeRoutingMenu', false),
routing: dexieSettingStore('routing', true), routing: dexieSettingStore('routing', true),
routingProfile: dexieSettingStore('routingProfile', 'bike'), routingProfile: dexieSettingStore('routingProfile', 'bike'),
privateRoads: dexieSettingStore('privateRoads', false), privateRoads: dexieSettingStore('privateRoads', false),
timestampsMode: dexieSettingStore('timestampsMode', TimestampsMode.PRESERVE_AVERAGE_SPEED),
currentBasemap: dexieSettingStore('currentBasemap', defaultBasemap), currentBasemap: dexieSettingStore('currentBasemap', defaultBasemap),
previousBasemap: dexieSettingStore('previousBasemap', defaultBasemap), previousBasemap: dexieSettingStore('previousBasemap', defaultBasemap),
selectedBasemapTree: dexieSettingStore('selectedBasemapTree', defaultBasemapTree), selectedBasemapTree: dexieSettingStore('selectedBasemapTree', defaultBasemapTree),
currentOverlays: dexieSettingStore('currentOverlays', defaultOverlays, false), currentOverlays: dexieSettingStore('currentOverlays', defaultOverlays, false),
previousOverlays: dexieSettingStore('previousOverlays', defaultOverlays), previousOverlays: dexieSettingStore('previousOverlays', defaultOverlays),
selectedOverlayTree: dexieSettingStore('selectedOverlayTree', defaultOverlayTree), selectedOverlayTree: dexieSettingStore('selectedOverlayTree', defaultOverlayTree),
currentOverpassQueries: dexieSettingStore('currentOverpassQueries', defaultOverpassQueries, false), currentOverpassQueries: dexieSettingStore(
'currentOverpassQueries',
defaultOverpassQueries,
false
),
selectedOverpassTree: dexieSettingStore('selectedOverpassTree', defaultOverpassTree), selectedOverpassTree: dexieSettingStore('selectedOverpassTree', defaultOverpassTree),
opacities: dexieSettingStore('opacities', defaultOpacities), opacities: dexieSettingStore('opacities', defaultOpacities),
customLayers: dexieSettingStore<Record<string, CustomLayer>>('customLayers', {}), customLayers: dexieSettingStore<Record<string, CustomLayer>>('customLayers', {}),
@@ -109,7 +172,7 @@ export const settings = {
streetViewSource: dexieSettingStore('streetViewSource', 'mapillary'), streetViewSource: dexieSettingStore('streetViewSource', 'mapillary'),
fileOrder: dexieSettingStore<string[]>('fileOrder', []), fileOrder: dexieSettingStore<string[]>('fileOrder', []),
defaultOpacity: dexieSettingStore('defaultOpacity', 0.7), defaultOpacity: dexieSettingStore('defaultOpacity', 0.7),
defaultWeight: dexieSettingStore('defaultWeight', (browser && window.innerWidth < 600) ? 8 : 5), defaultWidth: dexieSettingStore('defaultWidth', browser && window.innerWidth < 600 ? 8 : 5),
bottomPanelSize: dexieSettingStore('bottomPanelSize', 170), bottomPanelSize: dexieSettingStore('bottomPanelSize', 170),
rightPanelSize: dexieSettingStore('rightPanelSize', 240), rightPanelSize: dexieSettingStore('rightPanelSize', 240),
}; };
@@ -117,7 +180,7 @@ export const settings = {
// Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber // Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber
function dexieStore<T>(querier: () => T | Promise<T>, initial?: T): Readable<T> { function dexieStore<T>(querier: () => T | Promise<T>, initial?: T): Readable<T> {
let store = writable<T>(initial); let store = writable<T>(initial);
liveQuery(querier).subscribe(value => { liveQuery(querier).subscribe((value) => {
if (value !== undefined) { if (value !== undefined) {
store.set(value); store.set(value);
} }
@@ -151,7 +214,7 @@ export class GPXStatisticsTree {
let statistics = new GPXStatistics(); let statistics = new GPXStatistics();
let id = item.getIdAtLevel(this.level); let id = item.getIdAtLevel(this.level);
if (id === undefined || id === 'waypoints') { if (id === undefined || id === 'waypoints') {
Object.keys(this.statistics).forEach(key => { Object.keys(this.statistics).forEach((key) => {
if (this.statistics[key] instanceof GPXStatistics) { if (this.statistics[key] instanceof GPXStatistics) {
statistics.mergeWith(this.statistics[key]); statistics.mergeWith(this.statistics[key]);
} else { } else {
@@ -168,26 +231,30 @@ export class GPXStatisticsTree {
} }
return statistics; return statistics;
} }
}; }
export type GPXFileWithStatistics = { file: GPXFile, statistics: GPXStatisticsTree }; export type GPXFileWithStatistics = { file: GPXFile; statistics: GPXStatisticsTree };
// Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber, also takes care of the conversion to a GPXFile object // Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber, also takes care of the conversion to a GPXFile object
function dexieGPXFileStore(id: string): Readable<GPXFileWithStatistics> & { destroy: () => void } { function dexieGPXFileStore(id: string): Readable<GPXFileWithStatistics> & { destroy: () => void } {
let store = writable<GPXFileWithStatistics>(undefined); let store = writable<GPXFileWithStatistics>(undefined);
let query = liveQuery(() => db.files.get(id)).subscribe(value => { let query = liveQuery(() => db.files.get(id)).subscribe((value) => {
if (value !== undefined) { if (value !== undefined) {
let gpx = new GPXFile(value); let gpx = new GPXFile(value);
updateAnchorPoints(gpx); updateAnchorPoints(gpx);
let statistics = new GPXStatisticsTree(gpx); let statistics = new GPXStatisticsTree(gpx);
if (!fileState.has(id)) { // Update the map bounds for new files if (!fileState.has(id)) {
updateTargetMapBounds(id, statistics.getStatisticsFor(new ListFileItem(id)).global.bounds); // Update the map bounds for new files
updateTargetMapBounds(
id,
statistics.getStatisticsFor(new ListFileItem(id)).global.bounds
);
} }
fileState.set(id, gpx); fileState.set(id, gpx);
store.set({ store.set({
file: gpx, file: gpx,
statistics statistics,
}); });
if (get(selection).hasAnyChildren(new ListFileItem(id))) { if (get(selection).hasAnyChildren(new ListFileItem(id))) {
@@ -200,7 +267,7 @@ function dexieGPXFileStore(id: string): Readable<GPXFileWithStatistics> & { dest
destroy: () => { destroy: () => {
fileState.delete(id); fileState.delete(id);
query.unsubscribe(); query.unsubscribe();
} },
}; };
} }
@@ -212,22 +279,30 @@ function updateSelection(updatedFiles: GPXFile[], deletedFileIds: string[]) {
if (file) { if (file) {
items.forEach((item) => { items.forEach((item) => {
if (item instanceof ListTrackItem) { if (item instanceof ListTrackItem) {
let newTrackIndex = file.trk.findIndex((track) => track._data.trackIndex === item.getTrackIndex()); let newTrackIndex = file.trk.findIndex(
(track) => track._data.trackIndex === item.getTrackIndex()
);
if (newTrackIndex === -1) { if (newTrackIndex === -1) {
removedItems.push(item); removedItems.push(item);
} }
} else if (item instanceof ListTrackSegmentItem) { } else if (item instanceof ListTrackSegmentItem) {
let newTrackIndex = file.trk.findIndex((track) => track._data.trackIndex === item.getTrackIndex()); let newTrackIndex = file.trk.findIndex(
(track) => track._data.trackIndex === item.getTrackIndex()
);
if (newTrackIndex === -1) { if (newTrackIndex === -1) {
removedItems.push(item); removedItems.push(item);
} else { } else {
let newSegmentIndex = file.trk[newTrackIndex].trkseg.findIndex((segment) => segment._data.segmentIndex === item.getSegmentIndex()); let newSegmentIndex = file.trk[newTrackIndex].trkseg.findIndex(
(segment) => segment._data.segmentIndex === item.getSegmentIndex()
);
if (newSegmentIndex === -1) { if (newSegmentIndex === -1) {
removedItems.push(item); removedItems.push(item);
} }
} }
} else if (item instanceof ListWaypointItem) { } else if (item instanceof ListWaypointItem) {
let newWaypointIndex = file.wpt.findIndex((wpt) => wpt._data.index === item.getWaypointIndex()); let newWaypointIndex = file.wpt.findIndex(
(wpt) => wpt._data.index === item.getWaypointIndex()
);
if (newWaypointIndex === -1) { if (newWaypointIndex === -1) {
removedItems.push(item); removedItems.push(item);
} }
@@ -257,9 +332,10 @@ function updateSelection(updatedFiles: GPXFile[], deletedFileIds: string[]) {
// Commit the changes to the file state to the database // Commit the changes to the file state to the database
function commitFileStateChange(newFileState: ReadonlyMap<string, GPXFile>, patch: Patch[]) { function commitFileStateChange(newFileState: ReadonlyMap<string, GPXFile>, patch: Patch[]) {
let changedFileIds = getChangedFileIds(patch); let changedFileIds = getChangedFileIds(patch);
let updatedFileIds: string[] = [], deletedFileIds: string[] = []; let updatedFileIds: string[] = [],
deletedFileIds: string[] = [];
changedFileIds.forEach(id => { changedFileIds.forEach((id) => {
if (newFileState.has(id)) { if (newFileState.has(id)) {
updatedFileIds.push(id); updatedFileIds.push(id);
} else { } else {
@@ -267,8 +343,10 @@ function commitFileStateChange(newFileState: ReadonlyMap<string, GPXFile>, patch
} }
}); });
let updatedFiles = updatedFileIds.map(id => newFileState.get(id)).filter(file => file !== undefined) as GPXFile[]; let updatedFiles = updatedFileIds
updatedFileIds = updatedFiles.map(file => file._data.id); .map((id) => newFileState.get(id))
.filter((file) => file !== undefined) as GPXFile[];
updatedFileIds = updatedFiles.map((file) => file._data.id);
updateSelection(updatedFiles, deletedFileIds); updateSelection(updatedFiles, deletedFileIds);
@@ -284,13 +362,15 @@ function commitFileStateChange(newFileState: ReadonlyMap<string, GPXFile>, patch
}); });
} }
export const fileObservers: Writable<Map<string, Readable<GPXFileWithStatistics | undefined> & { destroy?: () => void }>> = writable(new Map()); export const fileObservers: Writable<
Map<string, Readable<GPXFileWithStatistics | undefined> & { destroy?: () => void }>
> = writable(new Map());
const fileState: Map<string, GPXFile> = new Map(); // Used to generate patches const fileState: Map<string, GPXFile> = new Map(); // Used to generate patches
// Observe the file ids in the database, and maintain a map of file observers for the corresponding files // Observe the file ids in the database, and maintain a map of file observers for the corresponding files
export function observeFilesFromDatabase(fitBounds: boolean) { export function observeFilesFromDatabase(fitBounds: boolean) {
let initialize = true; let initialize = true;
liveQuery(() => db.fileids.toArray()).subscribe(dbFileIds => { liveQuery(() => db.fileids.toArray()).subscribe((dbFileIds) => {
if (initialize) { if (initialize) {
if (fitBounds && dbFileIds.length > 0) { if (fitBounds && dbFileIds.length > 0) {
initTargetMapBounds(dbFileIds); initTargetMapBounds(dbFileIds);
@@ -298,17 +378,21 @@ export function observeFilesFromDatabase(fitBounds: boolean) {
initialize = false; initialize = false;
} }
// Find new files to observe // Find new files to observe
let newFiles = dbFileIds.filter(id => !get(fileObservers).has(id)).sort((a, b) => parseInt(a.split('-')[1]) - parseInt(b.split('-')[1])); let newFiles = dbFileIds
.filter((id) => !get(fileObservers).has(id))
.sort((a, b) => parseInt(a.split('-')[1]) - parseInt(b.split('-')[1]));
// Find deleted files to stop observing // Find deleted files to stop observing
let deletedFiles = Array.from(get(fileObservers).keys()).filter(id => !dbFileIds.find(fileId => fileId === id)); let deletedFiles = Array.from(get(fileObservers).keys()).filter(
(id) => !dbFileIds.find((fileId) => fileId === id)
);
// Update the store // Update the store
if (newFiles.length > 0 || deletedFiles.length > 0) { if (newFiles.length > 0 || deletedFiles.length > 0) {
fileObservers.update($files => { fileObservers.update(($files) => {
newFiles.forEach(id => { newFiles.forEach((id) => {
$files.set(id, dexieGPXFileStore(id)); $files.set(id, dexieGPXFileStore(id));
}); });
deletedFiles.forEach(id => { deletedFiles.forEach((id) => {
$files.get(id)?.destroy?.(); $files.get(id)?.destroy?.();
$files.delete(id); $files.delete(id);
}); });
@@ -343,15 +427,28 @@ export function getStatistics(fileId: string): GPXStatisticsTree | undefined {
} }
const patchIndex: Readable<number> = dexieStore(() => db.settings.get('patchIndex'), -1); const patchIndex: Readable<number> = dexieStore(() => db.settings.get('patchIndex'), -1);
const patchMinMaxIndex: Readable<{ min: number, max: number }> = dexieStore(() => db.patches.orderBy(':id').keys().then(keys => { const patchMinMaxIndex: Readable<{ min: number; max: number }> = dexieStore(
() =>
db.patches
.orderBy(':id')
.keys()
.then((keys) => {
if (keys.length === 0) { if (keys.length === 0) {
return { min: 0, max: 0 }; return { min: 0, max: 0 };
} else { } else {
return { min: keys[0], max: keys[keys.length - 1] + 1 }; return { min: keys[0], max: keys[keys.length - 1] + 1 };
} }
}), { min: 0, max: 0 }); }),
export const canUndo: Readable<boolean> = derived([patchIndex, patchMinMaxIndex], ([$patchIndex, $patchMinMaxIndex]) => $patchIndex >= $patchMinMaxIndex.min); { min: 0, max: 0 }
export const canRedo: Readable<boolean> = derived([patchIndex, patchMinMaxIndex], ([$patchIndex, $patchMinMaxIndex]) => $patchIndex < $patchMinMaxIndex.max - 1); );
export const canUndo: Readable<boolean> = derived(
[patchIndex, patchMinMaxIndex],
([$patchIndex, $patchMinMaxIndex]) => $patchIndex >= $patchMinMaxIndex.min
);
export const canRedo: Readable<boolean> = derived(
[patchIndex, patchMinMaxIndex],
([$patchIndex, $patchMinMaxIndex]) => $patchIndex < $patchMinMaxIndex.max - 1
);
// Helper function to apply a callback to the global file state // Helper function to apply a callback to the global file state
function applyGlobal(callback: (files: Map<string, GPXFile>) => void) { function applyGlobal(callback: (files: Map<string, GPXFile>) => void) {
@@ -379,7 +476,12 @@ function applyToFiles(fileIds: string[], callback: (file: WritableDraft<GPXFile>
} }
// Helper function to apply different callbacks to multiple files // Helper function to apply different callbacks to multiple files
function applyEachToFilesAndGlobal(fileIds: string[], callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[], globalCallback: (files: Map<string, GPXFile>, context?: any) => void, context?: any) { function applyEachToFilesAndGlobal(
fileIds: string[],
callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[],
globalCallback: (files: Map<string, GPXFile>, context?: any) => void,
context?: any
) {
const [newFileState, patch, inversePatch] = produceWithPatches(fileState, (draft) => { const [newFileState, patch, inversePatch] = produceWithPatches(fileState, (draft) => {
fileIds.forEach((fileId, index) => { fileIds.forEach((fileId, index) => {
let file = draft.get(fileId); let file = draft.get(fileId);
@@ -402,16 +504,22 @@ async function storePatches(patch: Patch[], inversePatch: Patch[]) {
db.patches.where(':id').above(get(patchIndex)).delete(); // Delete all patches after the current patch to avoid redoing them db.patches.where(':id').above(get(patchIndex)).delete(); // Delete all patches after the current patch to avoid redoing them
let minmax = get(patchMinMaxIndex); let minmax = get(patchMinMaxIndex);
if (minmax.max - minmax.min + 1 > MAX_PATCHES) { if (minmax.max - minmax.min + 1 > MAX_PATCHES) {
db.patches.where(':id').belowOrEqual(get(patchMinMaxIndex).max - MAX_PATCHES).delete(); db.patches
.where(':id')
.belowOrEqual(get(patchMinMaxIndex).max - MAX_PATCHES)
.delete();
} }
} }
db.transaction('rw', db.patches, db.settings, async () => { db.transaction('rw', db.patches, db.settings, async () => {
let index = get(patchIndex) + 1; let index = get(patchIndex) + 1;
await db.patches.put({ await db.patches.put(
{
patch, patch,
inversePatch, inversePatch,
index,
},
index index
}, index); );
await db.settings.put(index, 'patchIndex'); await db.settings.put(index, 'patchIndex');
}); });
} }
@@ -469,7 +577,12 @@ export const dbUtils = {
applyToFiles: (ids: string[], callback: (file: WritableDraft<GPXFile>) => void) => { applyToFiles: (ids: string[], callback: (file: WritableDraft<GPXFile>) => void) => {
applyToFiles(ids, callback); applyToFiles(ids, callback);
}, },
applyEachToFilesAndGlobal: (ids: string[], callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[], globalCallback: (files: Map<string, GPXFile>, context?: any) => void, context?: any) => { applyEachToFilesAndGlobal: (
ids: string[],
callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[],
globalCallback: (files: Map<string, GPXFile>, context?: any) => void,
context?: any
) => {
applyEachToFilesAndGlobal(ids, callbacks, globalCallback, context); applyEachToFilesAndGlobal(ids, callbacks, globalCallback, context);
}, },
duplicateSelection: () => { duplicateSelection: () => {
@@ -493,20 +606,33 @@ export const dbUtils = {
if (level === ListLevel.TRACK) { if (level === ListLevel.TRACK) {
for (let item of items) { for (let item of items) {
let trackIndex = (item as ListTrackItem).getTrackIndex(); let trackIndex = (item as ListTrackItem).getTrackIndex();
file.replaceTracks(trackIndex + 1, trackIndex, [file.trk[trackIndex].clone()]); file.replaceTracks(trackIndex + 1, trackIndex, [
file.trk[trackIndex].clone(),
]);
} }
} else if (level === ListLevel.SEGMENT) { } else if (level === ListLevel.SEGMENT) {
for (let item of items) { for (let item of items) {
let trackIndex = (item as ListTrackSegmentItem).getTrackIndex(); let trackIndex = (item as ListTrackSegmentItem).getTrackIndex();
let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex(); let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex();
file.replaceTrackSegments(trackIndex, segmentIndex + 1, segmentIndex, [file.trk[trackIndex].trkseg[segmentIndex].clone()]); file.replaceTrackSegments(
trackIndex,
segmentIndex + 1,
segmentIndex,
[file.trk[trackIndex].trkseg[segmentIndex].clone()]
);
} }
} else if (level === ListLevel.WAYPOINTS) { } else if (level === ListLevel.WAYPOINTS) {
file.replaceWaypoints(file.wpt.length, file.wpt.length - 1, file.wpt.map((wpt) => wpt.clone())); file.replaceWaypoints(
file.wpt.length,
file.wpt.length - 1,
file.wpt.map((wpt) => wpt.clone())
);
} else if (level === ListLevel.WAYPOINT) { } else if (level === ListLevel.WAYPOINT) {
for (let item of items) { for (let item of items) {
let waypointIndex = (item as ListWaypointItem).getWaypointIndex(); let waypointIndex = (item as ListWaypointItem).getWaypointIndex();
file.replaceWaypoints(waypointIndex + 1, waypointIndex, [file.wpt[waypointIndex].clone()]); file.replaceWaypoints(waypointIndex + 1, waypointIndex, [
file.wpt[waypointIndex].clone(),
]);
} }
} }
} }
@@ -515,16 +641,23 @@ export const dbUtils = {
}); });
}, },
addNewTrack: (fileId: string) => { addNewTrack: (fileId: string) => {
dbUtils.applyToFile(fileId, (file) => file.replaceTracks(file.trk.length, file.trk.length, [new Track()])); dbUtils.applyToFile(fileId, (file) =>
file.replaceTracks(file.trk.length, file.trk.length, [new Track()])
);
}, },
addNewSegment: (fileId: string, trackIndex: number) => { addNewSegment: (fileId: string, trackIndex: number) => {
dbUtils.applyToFile(fileId, (file) => { dbUtils.applyToFile(fileId, (file) => {
let track = file.trk[trackIndex]; let track = file.trk[trackIndex];
track.replaceTrackSegments(track.trkseg.length, track.trkseg.length, [new TrackSegment()]); track.replaceTrackSegments(track.trkseg.length, track.trkseg.length, [
new TrackSegment(),
]);
}); });
}, },
reverseSelection: () => { reverseSelection: () => {
if (!get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints']) || get(gpxStatistics).local.points?.length <= 1) { if (
!get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints']) ||
get(gpxStatistics).local.points?.length <= 1
) {
return; return;
} }
applyGlobal((draft) => { applyGlobal((draft) => {
@@ -581,13 +714,13 @@ export const dbUtils = {
let target: ListItem = new ListRootItem(); let target: ListItem = new ListRootItem();
let targetFile: GPXFile | undefined = undefined; let targetFile: GPXFile | undefined = undefined;
let toMerge: { let toMerge: {
trk: Track[], trk: Track[];
trkseg: TrackSegment[], trkseg: TrackSegment[];
wpt: Waypoint[] wpt: Waypoint[];
} = { } = {
trk: [], trk: [],
trkseg: [], trkseg: [],
wpt: [] wpt: [],
}; };
applyToOrderedSelectedItemsFromFile((fileId, level, items) => { applyToOrderedSelectedItemsFromFile((fileId, level, items) => {
let file = draft.get(fileId); let file = draft.get(fileId);
@@ -595,7 +728,11 @@ export const dbUtils = {
if (file && originalFile) { if (file && originalFile) {
if (level === ListLevel.FILE) { if (level === ListLevel.FILE) {
toMerge.trk.push(...originalFile.trk.map((track) => track.clone())); toMerge.trk.push(...originalFile.trk.map((track) => track.clone()));
toMerge.wpt.push(...originalFile.wpt.map((wpt) => wpt.clone())); for (const wpt of originalFile.wpt) {
if (!toMerge.wpt.some((w) => w.equals(wpt))) {
toMerge.wpt.push(wpt.clone());
}
}
if (first) { if (first) {
target = items[0]; target = items[0];
targetFile = file; targetFile = file;
@@ -606,8 +743,15 @@ export const dbUtils = {
if (level === ListLevel.TRACK) { if (level === ListLevel.TRACK) {
items.forEach((item, index) => { items.forEach((item, index) => {
let trackIndex = (item as ListTrackItem).getTrackIndex(); let trackIndex = (item as ListTrackItem).getTrackIndex();
toMerge.trkseg.splice(0, 0, ...originalFile.trk[trackIndex].trkseg.map((segment) => segment.clone())); toMerge.trkseg.splice(
if (index === items.length - 1) { // Order is reversed, so the last track is the first one and the one to keep 0,
0,
...originalFile.trk[trackIndex].trkseg.map((segment) =>
segment.clone()
)
);
if (index === items.length - 1) {
// Order is reversed, so the last track is the first one and the one to keep
target = item; target = item;
file.trk[trackIndex].trkseg = []; file.trk[trackIndex].trkseg = [];
} else { } else {
@@ -618,10 +762,15 @@ export const dbUtils = {
items.forEach((item, index) => { items.forEach((item, index) => {
let trackIndex = (item as ListTrackSegmentItem).getTrackIndex(); let trackIndex = (item as ListTrackSegmentItem).getTrackIndex();
let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex(); let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex();
if (index === items.length - 1) { // Order is reversed, so the last segment is the first one and the one to keep if (index === items.length - 1) {
// Order is reversed, so the last segment is the first one and the one to keep
target = item; target = item;
} }
toMerge.trkseg.splice(0, 0, originalFile.trk[trackIndex].trkseg[segmentIndex].clone()); toMerge.trkseg.splice(
0,
0,
originalFile.trk[trackIndex].trkseg[segmentIndex].clone()
);
file.trk[trackIndex].trkseg.splice(segmentIndex, 1); file.trk[trackIndex].trkseg.splice(segmentIndex, 1);
}); });
} }
@@ -633,15 +782,24 @@ export const dbUtils = {
if (mergeTraces) { if (mergeTraces) {
let statistics = get(gpxStatistics); let statistics = get(gpxStatistics);
let speed = statistics.global.speed.moving > 0 ? statistics.global.speed.moving : undefined; let speed =
statistics.global.speed.moving > 0 ? statistics.global.speed.moving : undefined;
let startTime: Date | undefined = undefined; let startTime: Date | undefined = undefined;
if (speed !== undefined) { if (speed !== undefined) {
if (statistics.local.points.length > 0 && statistics.local.points[0].time !== undefined) { if (
statistics.local.points.length > 0 &&
statistics.local.points[0].time !== undefined
) {
startTime = statistics.local.points[0].time; startTime = statistics.local.points[0].time;
} else { } else {
let index = statistics.local.points.findIndex((point) => point.time !== undefined); let index = statistics.local.points.findIndex(
(point) => point.time !== undefined
);
if (index !== -1) { if (index !== -1) {
startTime = new Date(statistics.local.points[index].time.getTime() - 1000 * 3600 * statistics.local.distance.total[index] / speed); startTime = new Date(
statistics.local.points[index].time.getTime() -
(1000 * 3600 * statistics.local.distance.total[index]) / speed
);
} }
} }
} }
@@ -650,7 +808,14 @@ export const dbUtils = {
let s = new TrackSegment(); let s = new TrackSegment();
toMerge.trk.map((track) => { toMerge.trk.map((track) => {
track.trkseg.forEach((segment) => { track.trkseg.forEach((segment) => {
s.replaceTrackPoints(s.trkpt.length, s.trkpt.length, segment.trkpt.slice(), speed, startTime, removeGaps); s.replaceTrackPoints(
s.trkpt.length,
s.trkpt.length,
segment.trkpt.slice(),
speed,
startTime,
removeGaps
);
}); });
}); });
toMerge.trk = [toMerge.trk[0]]; toMerge.trk = [toMerge.trk[0]];
@@ -659,7 +824,14 @@ export const dbUtils = {
if (toMerge.trkseg.length > 0) { if (toMerge.trkseg.length > 0) {
let s = new TrackSegment(); let s = new TrackSegment();
toMerge.trkseg.forEach((segment) => { toMerge.trkseg.forEach((segment) => {
s.replaceTrackPoints(s.trkpt.length, s.trkpt.length, segment.trkpt.slice(), speed, startTime, removeGaps); s.replaceTrackPoints(
s.trkpt.length,
s.trkpt.length,
segment.trkpt.slice(),
speed,
startTime,
removeGaps
);
}); });
toMerge.trkseg = [s]; toMerge.trkseg = [s];
} }
@@ -675,7 +847,12 @@ export const dbUtils = {
} else if (target instanceof ListTrackSegmentItem) { } else if (target instanceof ListTrackSegmentItem) {
let trackIndex = target.getTrackIndex(); let trackIndex = target.getTrackIndex();
let segmentIndex = target.getSegmentIndex(); let segmentIndex = target.getSegmentIndex();
targetFile.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex - 1, toMerge.trkseg); targetFile.replaceTrackSegments(
trackIndex,
segmentIndex,
segmentIndex - 1,
toMerge.trkseg
);
} }
} }
}); });
@@ -698,11 +875,15 @@ export const dbUtils = {
start -= length; start -= length;
end -= length; end -= length;
} else if (level === ListLevel.TRACK) { } else if (level === ListLevel.TRACK) {
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex()); let trackIndices = items.map((item) =>
(item as ListTrackItem).getTrackIndex()
);
file.crop(start, end, trackIndices); file.crop(start, end, trackIndices);
} else if (level === ListLevel.SEGMENT) { } else if (level === ListLevel.SEGMENT) {
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()]; let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex()); let segmentIndices = items.map((item) =>
(item as ListTrackSegmentItem).getSegmentIndex()
);
file.crop(start, end, trackIndices, segmentIndices); file.crop(start, end, trackIndices, segmentIndices);
} }
} }
@@ -722,14 +903,17 @@ export const dbUtils = {
return { return {
wptIndex: wptIndex, wptIndex: wptIndex,
index: [0], index: [0],
distance: Number.MAX_VALUE distance: Number.MAX_VALUE,
}; };
}) });
file.trk.forEach((track, index) => { file.trk.forEach((track, index) => {
track.getSegments().forEach((segment) => { track.getSegments().forEach((segment) => {
segment.trkpt.forEach((point) => { segment.trkpt.forEach((point) => {
file.wpt.forEach((wpt, wptIndex) => { file.wpt.forEach((wpt, wptIndex) => {
let dist = distance(point.getCoordinates(), wpt.getCoordinates()); let dist = distance(
point.getCoordinates(),
wpt.getCoordinates()
);
if (dist < closest[wptIndex].distance) { if (dist < closest[wptIndex].distance) {
closest[wptIndex].distance = dist; closest[wptIndex].distance = dist;
closest[wptIndex].index = [index]; closest[wptIndex].index = [index];
@@ -737,7 +921,7 @@ export const dbUtils = {
closest[wptIndex].index.push(index); closest[wptIndex].index.push(index);
} }
}); });
}) });
}); });
}); });
@@ -752,9 +936,16 @@ export const dbUtils = {
return t; return t;
}); });
newFile.replaceTracks(0, file.trk.length - 1, tracks); newFile.replaceTracks(0, file.trk.length - 1, tracks);
newFile.replaceWaypoints(0, file.wpt.length - 1, closest.filter((c) => c.index.includes(index)).map((c) => file.wpt[c.wptIndex])); newFile.replaceWaypoints(
0,
file.wpt.length - 1,
closest
.filter((c) => c.index.includes(index))
.map((c) => file.wpt[c.wptIndex])
);
newFile._data.id = fileIds[index]; newFile._data.id = fileIds[index];
newFile.metadata.name = track.name ?? `${file.metadata.name} (${index + 1})`; newFile.metadata.name =
track.name ?? `${file.metadata.name} (${index + 1})`;
draft.set(newFile._data.id, freeze(newFile)); draft.set(newFile._data.id, freeze(newFile));
}); });
} else if (file.trk.length === 1) { } else if (file.trk.length === 1) {
@@ -764,13 +955,16 @@ export const dbUtils = {
return { return {
wptIndex: wptIndex, wptIndex: wptIndex,
index: [0], index: [0],
distance: Number.MAX_VALUE distance: Number.MAX_VALUE,
}; };
}) });
file.trk[0].trkseg.forEach((segment, index) => { file.trk[0].trkseg.forEach((segment, index) => {
segment.trkpt.forEach((point) => { segment.trkpt.forEach((point) => {
file.wpt.forEach((wpt, wptIndex) => { file.wpt.forEach((wpt, wptIndex) => {
let dist = distance(point.getCoordinates(), wpt.getCoordinates()); let dist = distance(
point.getCoordinates(),
wpt.getCoordinates()
);
if (dist < closest[wptIndex].distance) { if (dist < closest[wptIndex].distance) {
closest[wptIndex].distance = dist; closest[wptIndex].distance = dist;
closest[wptIndex].index = [index]; closest[wptIndex].index = [index];
@@ -783,8 +977,16 @@ export const dbUtils = {
file.trk[0].trkseg.forEach((segment, index) => { file.trk[0].trkseg.forEach((segment, index) => {
let newFile = file.clone(); let newFile = file.clone();
newFile.replaceTrackSegments(0, 0, file.trk[0].trkseg.length - 1, [segment]); newFile.replaceTrackSegments(0, 0, file.trk[0].trkseg.length - 1, [
newFile.replaceWaypoints(0, file.wpt.length - 1, closest.filter((c) => c.index.includes(index)).map((c) => file.wpt[c.wptIndex])); segment,
]);
newFile.replaceWaypoints(
0,
file.wpt.length - 1,
closest
.filter((c) => c.index.includes(index))
.map((c) => file.wpt[c.wptIndex])
);
newFile._data.id = fileIds[index]; newFile._data.id = fileIds[index];
newFile.metadata.name = `${file.trk[0].name ?? file.metadata.name} (${index + 1})`; newFile.metadata.name = `${file.trk[0].name ?? file.metadata.name} (${index + 1})`;
draft.set(newFile._data.id, freeze(newFile)); draft.set(newFile._data.id, freeze(newFile));
@@ -813,7 +1015,13 @@ export const dbUtils = {
}); });
}); });
}, },
split(fileId: string, trackIndex: number, segmentIndex: number, coordinates: Coordinates, trkptIndex?: number) { split(
fileId: string,
trackIndex: number,
segmentIndex: number,
coordinates: Coordinates,
trkptIndex?: number
) {
let splitType = get(splitAs); let splitType = get(splitAs);
return applyGlobal((draft) => { return applyGlobal((draft) => {
let file = getFile(fileId); let file = getFile(fileId);
@@ -831,7 +1039,10 @@ export const dbUtils = {
let absoluteIndex = minIndex; let absoluteIndex = minIndex;
file.forEachSegment((seg, trkIndex, segIndex) => { file.forEachSegment((seg, trkIndex, segIndex) => {
if ((trkIndex < trackIndex && splitType === SplitType.FILES) || (trkIndex === trackIndex && segIndex < segmentIndex)) { if (
(trkIndex < trackIndex && splitType === SplitType.FILES) ||
(trkIndex === trackIndex && segIndex < segmentIndex)
) {
absoluteIndex += seg.trkpt.length; absoluteIndex += seg.trkpt.length;
} }
}); });
@@ -861,13 +1072,21 @@ export const dbUtils = {
start.crop(0, minIndex); start.crop(0, minIndex);
let end = segment.clone(); let end = segment.clone();
end.crop(minIndex, segment.trkpt.length - 1); end.crop(minIndex, segment.trkpt.length - 1);
newFile.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex, [start, end]); newFile.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex, [
start,
end,
]);
} }
} }
} }
}); });
}, },
cleanSelection: (bounds: [Coordinates, Coordinates], inside: boolean, deleteTrackPoints: boolean, deleteWaypoints: boolean) => { cleanSelection: (
bounds: [Coordinates, Coordinates],
inside: boolean,
deleteTrackPoints: boolean,
deleteWaypoints: boolean
) => {
if (get(selection).size === 0) { if (get(selection).size === 0) {
return; return;
} }
@@ -878,16 +1097,35 @@ export const dbUtils = {
if (level === ListLevel.FILE) { if (level === ListLevel.FILE) {
file.clean(bounds, inside, deleteTrackPoints, deleteWaypoints); file.clean(bounds, inside, deleteTrackPoints, deleteWaypoints);
} else if (level === ListLevel.TRACK) { } else if (level === ListLevel.TRACK) {
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex()); let trackIndices = items.map((item) =>
file.clean(bounds, inside, deleteTrackPoints, deleteWaypoints, trackIndices); (item as ListTrackItem).getTrackIndex()
);
file.clean(
bounds,
inside,
deleteTrackPoints,
deleteWaypoints,
trackIndices
);
} else if (level === ListLevel.SEGMENT) { } else if (level === ListLevel.SEGMENT) {
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()]; let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex()); let segmentIndices = items.map((item) =>
file.clean(bounds, inside, deleteTrackPoints, deleteWaypoints, trackIndices, segmentIndices); (item as ListTrackSegmentItem).getSegmentIndex()
);
file.clean(
bounds,
inside,
deleteTrackPoints,
deleteWaypoints,
trackIndices,
segmentIndices
);
} else if (level === ListLevel.WAYPOINTS) { } else if (level === ListLevel.WAYPOINTS) {
file.clean(bounds, inside, false, deleteWaypoints); file.clean(bounds, inside, false, deleteWaypoints);
} else if (level === ListLevel.WAYPOINT) { } else if (level === ListLevel.WAYPOINT) {
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex()); let waypointIndices = items.map((item) =>
(item as ListWaypointItem).getWaypointIndex()
);
file.clean(bounds, inside, false, deleteWaypoints, [], [], waypointIndices); file.clean(bounds, inside, false, deleteWaypoints, [], [], waypointIndices);
} }
} }
@@ -909,7 +1147,15 @@ export const dbUtils = {
let segmentIndex = item.getSegmentIndex(); let segmentIndex = item.getSegmentIndex();
let points = itemsAndPoints.get(item); let points = itemsAndPoints.get(item);
if (points) { if (points) {
file.replaceTrackPoints(trackIndex, segmentIndex, 0, file.trk[trackIndex].trkseg[segmentIndex].getNumberOfTrackPoints() - 1, points); file.replaceTrackPoints(
trackIndex,
segmentIndex,
0,
file.trk[trackIndex].trkseg[
segmentIndex
].getNumberOfTrackPoints() - 1,
points
);
} }
} }
} }
@@ -936,7 +1182,9 @@ export const dbUtils = {
}); });
} else { } else {
let fileIds = new Set<string>(); let fileIds = new Set<string>();
get(selection).getSelected().forEach((item) => { get(selection)
.getSelected()
.forEach((item) => {
fileIds.add(item.getFileId()); fileIds.add(item.getFileId());
}); });
let wpt = new Waypoint(waypoint); let wpt = new Waypoint(waypoint);
@@ -982,16 +1230,22 @@ export const dbUtils = {
if (level === ListLevel.FILE) { if (level === ListLevel.FILE) {
file.setHidden(hidden); file.setHidden(hidden);
} else if (level === ListLevel.TRACK) { } else if (level === ListLevel.TRACK) {
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex()); let trackIndices = items.map((item) =>
(item as ListTrackItem).getTrackIndex()
);
file.setHidden(hidden, trackIndices); file.setHidden(hidden, trackIndices);
} else if (level === ListLevel.SEGMENT) { } else if (level === ListLevel.SEGMENT) {
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()]; let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex()); let segmentIndices = items.map((item) =>
(item as ListTrackSegmentItem).getSegmentIndex()
);
file.setHidden(hidden, trackIndices, segmentIndices); file.setHidden(hidden, trackIndices, segmentIndices);
} else if (level === ListLevel.WAYPOINTS) { } else if (level === ListLevel.WAYPOINTS) {
file.setHiddenWaypoints(hidden); file.setHiddenWaypoints(hidden);
} else if (level === ListLevel.WAYPOINT) { } else if (level === ListLevel.WAYPOINT) {
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex()); let waypointIndices = items.map((item) =>
(item as ListWaypointItem).getWaypointIndex()
);
file.setHiddenWaypoints(hidden, waypointIndices); file.setHiddenWaypoints(hidden, waypointIndices);
} }
} }
@@ -1018,7 +1272,12 @@ export const dbUtils = {
for (let item of items) { for (let item of items) {
let trackIndex = (item as ListTrackSegmentItem).getTrackIndex(); let trackIndex = (item as ListTrackSegmentItem).getTrackIndex();
let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex(); let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex();
file.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex, []); file.replaceTrackSegments(
trackIndex,
segmentIndex,
segmentIndex,
[]
);
} }
} else if (level === ListLevel.WAYPOINTS) { } else if (level === ListLevel.WAYPOINTS) {
file.replaceWaypoints(0, file.wpt.length - 1, []); file.replaceWaypoints(0, file.wpt.length - 1, []);
@@ -1051,14 +1310,18 @@ export const dbUtils = {
}); });
} else if (level === ListLevel.SEGMENT) { } else if (level === ListLevel.SEGMENT) {
let trackIndex = (items[0] as ListTrackSegmentItem).getTrackIndex(); let trackIndex = (items[0] as ListTrackSegmentItem).getTrackIndex();
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex()); let segmentIndices = items.map((item) =>
(item as ListTrackSegmentItem).getSegmentIndex()
);
segmentIndices.forEach((segmentIndex) => { segmentIndices.forEach((segmentIndex) => {
points.push(...file.trk[trackIndex].trkseg[segmentIndex].getTrackPoints()); points.push(...file.trk[trackIndex].trkseg[segmentIndex].getTrackPoints());
}); });
} else if (level === ListLevel.WAYPOINTS) { } else if (level === ListLevel.WAYPOINTS) {
points.push(...file.wpt); points.push(...file.wpt);
} else if (level === ListLevel.WAYPOINT) { } else if (level === ListLevel.WAYPOINT) {
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex()); let waypointIndices = items.map((item) =>
(item as ListWaypointItem).getWaypointIndex()
);
points.push(...waypointIndices.map((waypointIndex) => file.wpt[waypointIndex])); points.push(...waypointIndices.map((waypointIndex) => file.wpt[waypointIndex]));
} }
} }
@@ -1076,16 +1339,22 @@ export const dbUtils = {
if (level === ListLevel.FILE) { if (level === ListLevel.FILE) {
file.addElevation(elevations); file.addElevation(elevations);
} else if (level === ListLevel.TRACK) { } else if (level === ListLevel.TRACK) {
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex()); let trackIndices = items.map((item) =>
(item as ListTrackItem).getTrackIndex()
);
file.addElevation(elevations, trackIndices, undefined, []); file.addElevation(elevations, trackIndices, undefined, []);
} else if (level === ListLevel.SEGMENT) { } else if (level === ListLevel.SEGMENT) {
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()]; let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex()); let segmentIndices = items.map((item) =>
(item as ListTrackSegmentItem).getSegmentIndex()
);
file.addElevation(elevations, trackIndices, segmentIndices, []); file.addElevation(elevations, trackIndices, segmentIndices, []);
} else if (level === ListLevel.WAYPOINTS) { } else if (level === ListLevel.WAYPOINTS) {
file.addElevation(elevations, [], [], undefined); file.addElevation(elevations, [], [], undefined);
} else if (level === ListLevel.WAYPOINT) { } else if (level === ListLevel.WAYPOINT) {
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex()); let waypointIndices = items.map((item) =>
(item as ListWaypointItem).getWaypointIndex()
);
file.addElevation(elevations, [], [], waypointIndices); file.addElevation(elevations, [], [], waypointIndices);
} }
} }
@@ -1112,7 +1381,7 @@ export const dbUtils = {
undo: () => { undo: () => {
if (get(canUndo)) { if (get(canUndo)) {
let index = get(patchIndex); let index = get(patchIndex);
db.patches.get(index).then(patch => { db.patches.get(index).then((patch) => {
if (patch) { if (patch) {
applyPatch(patch.inversePatch); applyPatch(patch.inversePatch);
db.settings.put(index - 1, 'patchIndex'); db.settings.put(index - 1, 'patchIndex');
@@ -1123,12 +1392,12 @@ export const dbUtils = {
redo: () => { redo: () => {
if (get(canRedo)) { if (get(canRedo)) {
let index = get(patchIndex) + 1; let index = get(patchIndex) + 1;
db.patches.get(index).then(patch => { db.patches.get(index).then((patch) => {
if (patch) { if (patch) {
applyPatch(patch.patch); applyPatch(patch.patch);
db.settings.put(index, 'patchIndex'); db.settings.put(index, 'patchIndex');
} }
}); });
} }
} },
} };

View File

@@ -2,9 +2,18 @@
title: Files and statistics title: Files and statistics
--- ---
<script> <script lang="ts">
import { ChartNoAxesColumn } from 'lucide-svelte'; import { ChartNoAxesColumn } from '@lucide/svelte';
import DocsNote from '$lib/components/docs/DocsNote.svelte'; import DocsNote from '$lib/components/docs/DocsNote.svelte';
import ElevationProfile from '$lib/components/elevation-profile/ElevationProfile.svelte';
import GPXStatistics from '$lib/components/GPXStatistics.svelte';
import { exampleGPXFile } from '$lib/assets/example';
import { writable } from 'svelte/store';
let gpxStatistics = writable(exampleGPXFile.getStatistics());
let slicedGPXStatistics = writable(undefined);
let additionalDatasets = writable(['speed', 'atemp']);
let elevationFill = writable(undefined);
</script> </script>
# { title } # { title }
@@ -37,11 +46,11 @@ You can also navigate through the files using the arrow keys on your keyboard, a
By right-clicking on a file tab, you can access the same actions as in the [edit menu](./menu/edit). By right-clicking on a file tab, you can access the same actions as in the [edit menu](./menu/edit).
### Vertical layout ### Tree layout
As mentioned in the [view options section](./menu/view), you can switch between a horizontal and a vertical layout for the file list. As mentioned in the [view options section](./menu/view), you can switch to a tree layout for the files list.
The vertical file list is useful when you have many files open, or files with multiple [tracks, segments, or points of interest](./gpx). This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
Indeed, this layout allows you to inspect the content of the files through collapsible sections. In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](./gpx) contained inside the files through collapsible sections.
You can also apply [edit actions](./menu/edit) and [tools](./toolbar) to internal file items. You can also apply [edit actions](./menu/edit) and [tools](./toolbar) to internal file items.
Furthermore, you can drag and drop the inner items to reorder them, or move them in the hierarchy or even to another file. Furthermore, you can drag and drop the inner items to reorder them, or move them in the hierarchy or even to another file.
@@ -71,6 +80,25 @@ Click on the profile to reset the selection.
You can also use the mouse wheel to zoom in and out on the elevation profile, and move left and right by dragging the profile while holding the <kbd>Shift</kbd> key. You can also use the mouse wheel to zoom in and out on the elevation profile, and move left and right by dragging the profile while holding the <kbd>Shift</kbd> key.
<div class="h-48 w-full">
<ElevationProfile
{gpxStatistics}
{slicedGPXStatistics}
{additionalDatasets}
{elevationFill}
/>
</div>
<div class="flex flex-col items-center -mt-6">
<div class="h-10 w-fit">
<GPXStatistics
{gpxStatistics}
{slicedGPXStatistics}
panelSize={120}
orientation={'horizontal'}
/>
</div>
</div>
### Additional data ### Additional data
Using the <kbd><ChartNoAxesColumn size="16" class="inline-block" style="margin-bottom: 2px"/></kbd> button at the bottom-right of the elevation profile, you can optionally color the elevation profile by: Using the <kbd><ChartNoAxesColumn size="16" class="inline-block" style="margin-bottom: 2px"/></kbd> button at the bottom-right of the elevation profile, you can optionally color the elevation profile by:

View File

@@ -25,7 +25,7 @@ This is where you can access common actions such as opening, closing, and export
At the bottom of the interface, you will find the list of files currently open in the application. At the bottom of the interface, you will find the list of files currently open in the application.
You can click on a file to select it and display its statistics below the list. You can click on a file to select it and display its statistics below the list.
In the [dedicated section](./files-and-stats), we will explain how to select multiple files and switch to a vertical layout for advanced file management. In the [dedicated section](./files-and-stats), we will explain how to select multiple files and switch to a tree layout for advanced file management.
## Toolbar ## Toolbar

View File

@@ -1,5 +1,5 @@
--- ---
title: GPX file format title: Фармат файла GPX
--- ---
<script> <script>
@@ -8,27 +8,27 @@ title: GPX file format
# { title } # { title }
The <a href="https://www.topografix.com/gpx.asp" target="_blank">GPX file format</a> is an open standard for exchanging GPS data between applications and GPS devices. <a href="https://www.topografix.com/gpx.asp" target="_blank">Фармат файла GPX</a> - гэта адкрыты стандарт для абмену дадзенымі GPS паміж праграмамі і прыладамі GPS.
It essentially consists of a series of GPS points encoding one or multiple GPS traces, and, optionally, some points of interest. Па сутнасці, ён складаецца з серыі кропак GPS, якія кадзіруюць адну або некалькі слядоў GPS, і, па жаданні, некаторыя кропкі цікавасці.
GPX files may also contain metadata, of which the **name** and **description** fields are the most useful for users. Файлы GPX могуць таксама ўтрымліваць метададзеныя, з якіх палі **імя** і **апісанне** найбольш карысныя для карыстальнікаў.
### <Waypoints size="16" class="inline-block" style="margin-bottom: 2px" /> Tracks, segments, and GPS points ### <Waypoints size="16" class="inline-block" style="margin-bottom: 2px" /> Трэкі, сегменты і кропкі GPS
As mentioned above, a GPX file can contain multiple GPS traces. Як згадвалася вышэй, файл GPX можа ўтрымліваць некалькі слядоў GPS.
These are organized in a hierarchical structure, with tracks at the top level. Яны арганізаваны ў іерархічнай структуры з трэкамі на верхнім узроўні.
- A **track** is made of a sequence of disconnected segments. - **Трэк** складаецца з паслядоўнасці раз'яднаных сегментаў.
Furthermore, it can contain metadata such as a **name**, a **description**, and **appearance properties**. Акрамя таго, ён можа ўтрымліваць метададзеныя, такія як **імя**, **апісанне** і **знешнія ўласцівасці**.
- A **segment** is a sequence of GPS points that form a continuous path. - **Сегмент** - гэта паслядоўнасць GPS кропак, якія ўтвараюць бесперапынны шлях.
- A **GPS point** is a location with a latitude, a longitude, and optionally a timestamp and an altitude. - **Кропка GPS** - гэта месцазнаходжанне з шыратой, даўгатой і, магчыма, пазнакай часу і вышыні.
Some devices also store additional information such as heart rate, cadence, temperature, and power. Некаторыя прылады таксама захоўваюць дадатковую інфармацыю, такую ​​як пульс, кадэнцыя, тэмпература і магутнасць.
In most cases, GPX files contain a single track with a single segment. У большасці выпадкаў файлы GPX утрымліваюць адзін трэк з адным сегментам.
However, the hierarchy described above allows for more advanced use cases, such as planning multi-day trips with several variants for each day. Аднак іерархія, апісаная вышэй, дазваляе выкарыстоўваць больш складаныя выпадкі, напрыклад, планаваць шматдзённыя паездкі з некалькімі варыянтамі на кожны дзень.
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Points of interest ### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Кропкі цікавасці
**Points of interest** (technically called _waypoints_) represent locations of interest to show either on a GPS device or on a digital map. **Кропкі цікавасці** (тэхнічна званыя _маршрутнымі кропкамі_) уяўляюць цікавыя месцы, якія можна паказаць альбо на прыладзе GPS, альбо на лічбавай карце.
In addition to its coordinates, a point of interest can have a **name** and a **description**. У дадатак да каардынатаў кропка цікавасці можа мець **імя** і **апісанне**.

View File

@@ -1,8 +1,8 @@
<script> <script>
import { HeartHandshake } from 'lucide-svelte'; import { HeartHandshake } from '@lucide/svelte';
</script> </script>
## <HeartHandshake size="18" class="mr-1 inline-block align-baseline" /> Help keep the website free (and ad-free) ## <HeartHandshake size="18" class="inline-block align-baseline" /> Help keep the website free (and ad-free)
Each time you add or move GPS points, our servers calculate the best route on the road network. Each time you add or move GPS points, our servers calculate the best route on the road network.
We also use APIs from <a href="https://mapbox.com" target="_blank">Mapbox</a> to display beautiful maps, retrieve elevation data and allow you to search for places. We also use APIs from <a href="https://mapbox.com" target="_blank">Mapbox</a> to display beautiful maps, retrieve elevation data and allow you to search for places.

View File

@@ -1,8 +1,8 @@
<script> <script>
import { Languages } from 'lucide-svelte'; import { Languages } from '@lucide/svelte';
</script> </script>
## <Languages size="18" class="mr-1 inline-block align-baseline" /> Translation ## <Languages size="18" class="inline-block align-baseline" /> Translation
The website is translated by volunteers using a collaborative translation platform. The website is translated by volunteers using a collaborative translation platform.
You can contribute by adding or improving translations on our <a href="https://crowdin.com/project/gpxstudio" target="_blank">Crowdin project</a>. You can contribute by adding or improving translations on our <a href="https://crowdin.com/project/gpxstudio" target="_blank">Crowdin project</a>.

View File

@@ -1,5 +1,5 @@
--- ---
title: Integration title: Інтэграцыя
--- ---
<script> <script>
@@ -9,18 +9,18 @@ title: Integration
# { title } # { title }
You can use **gpx.studio** to create maps showing your GPX files and embed them in your website. Вы можаце выкарыстоўваць **gpx.studio** для стварэння карт, якія паказваюць вашыя файлы GPX, і ўбудаваць іх у свой сайт.
All you need is: Усё, што вам трэба, гэта:
1. A <a href="https://account.mapbox.com/auth/signup" target="_blank">Mapbox access token</a> to load the map, and 1. <a href="https://account.mapbox.com/auth/signup" target="_blank">Ключ доступу Mapbox</a> для загрузкі карты і
2. GPX files hosted on your server or on Google Drive, or accessible via a public URL. 2. Файлы GPX, размешчаныя на вашым серверы або на Google Drive, або даступныя праз публічны URL.
You can then play with the configurator below to customize your map and generate the corresponding HTML code. Затым вы можаце пагуляць з канфігуратарам ніжэй, каб наладзіць сваю карту і стварыць адпаведны HTML-код.
<DocsNote type="warning"> <DocsNote type="warning">
You will need to set up <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS" target="_blank">Cross-Origin Resource Sharing (CORS)</a> headers on your server to allow <b>gpx.studio</b> to load your GPX files. Вам трэба будзе наладзіць загалоўкі <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS" target="_blank">Cross-Origin Resource Sharing (CORS)</a> на вашым серверы, каб дазволіць <b>gpx.studio</b> загружаць вашы файлы GPX.
</DocsNote> </DocsNote>

View File

@@ -10,61 +10,61 @@ title: Map controls
# { title } # { title }
The map controls are located on the right side of the interface. Элементы кіравання картай знаходзяцца ў правай частцы інтэрфэйсу.
These controls allow you to navigate the map, zoom in and out, and switch between different map styles. These controls allow you to navigate the map, zoom in and out, and switch between different map styles.
### <Diff size="16" class="inline-block" style="margin-bottom: 2px" /> Map navigation ### <Diff size="16" class="inline-block" style="margin-bottom: 2px" /> Навігацыя па карце
The controls at the top allow you to zoom in <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> and out <Minus size="16" class="inline-block" style="margin-bottom: 2px" />, and to change the orientation and tilt of the map <Compass size="16" class="inline-block" style="margin-bottom: 2px" />. Элементы кіравання ўверсе дазваляюць павялічваць <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> і памяншаць <Minus size="16" class="inline-block" style="margin-bottom: 2px" />, а таксама змяняць арыентацыю і нахіл карты <Compass size="16" class="inline-block" style="margin-bottom: 2px" />.
<DocsNote> <DocsNote>
To control the orientation and tilt of the map, you can also drag the map while holding <kbd>Ctrl</kbd>. Каб кіраваць арыентацыяй і нахілам карты, вы таксама можаце перацягнуць карту, утрымліваючы <kbd>Ctrl</kbd>.
</DocsNote> </DocsNote>
### <Search size="16" class="inline-block" style="margin-bottom: 2px" /> Search bar ### <Search size="16" class="inline-block" style="margin-bottom: 2px" /> Пошукавы радок
You can use the search bar to look for an address and navigate to it on the map. Вы можаце выкарыстоўваць пошукавы радок, каб знайсці адрас і перайсці да яго на карце.
### <LocateFixed size="16" class="inline-block" style="margin-bottom: 2px" /> Locate button ### <LocateFixed size="16" class="inline-block" style="margin-bottom: 2px" /> Кнопка месцазнаходжання
The locate button centers the map on your current location. Кнопка цэнтруе карту на вашым бягучым месцазнаходжанні.
<DocsNote> <DocsNote>
This only works if you have allowed your browser and <b>gpx.studio</b> to access your location. Гэта працуе, толькі калі вы дазволілі вашаму браўзеру і <b>gpx.studio</b> доступ да вашага месцазнаходжання.
</DocsNote> </DocsNote>
### <PersonStanding size="16" class="inline-block" style="margin-bottom: 2px" /> Street view ### <PersonStanding size="16" class="inline-block" style="margin-bottom: 2px" /> Прагляд вуліц
This button can be used to enable street view mode on the map. Гэтую кнопку можна выкарыстоўваць для ўключэння рэжыму прагляду вуліц на карце.
Depending on the street view source chosen in the [settings](./menu/settings), street view imagery can be accessed differently. У залежнасці ад крыніцы прагляду вуліц, абранай у [наладах](./menu/settings), да прагляду вуліц можна атрымаць доступ па-рознаму.
- <a href="https://www.mapillary.com/" target="_blank">Mapillary</a>: the street view coverage will appear as green lines on the map. When zoomed in enough, green dots will show the exact locations where street view imagery is available. Hovering over a green dot will show the street view image at that location. - <a href="https://www.mapillary.com/" target="_blank">Mapillary</a>: прагляд вуліц будзе адлюстроўвацца на карце ў выглядзе зялёных ліній. Пры дастатковым павелічэнні зялёныя кропкі будуць паказваць дакладныя месцы, дзе даступныя здымкі вуліц. Пры навядзенні курсора на зялёную кропку будзе паказаны здымак вуліцы ў гэтым месцы.
- <a href="https://www.google.com/streetview/" target="_blank">Google Street View</a>: click on the map to open a new tab with the street view imagery at that location. - <a href="https://www.google.com/streetview/" target="_blank">Google Street View</a>: націсніце на карту, каб адкрыць новую ўкладку са здымкамі вуліц у гэтым месцы.
### <Layers size="16" class="inline-block" style="margin-bottom: 2px" /> Map layers ### <Layers size="16" class="inline-block" style="margin-bottom: 2px" /> Слаі карты
The map layers button allows you to switch between different basemaps, and toggle map overlays and categories of points of interest. Кнопка слаёў карты дазваляе вам пераключацца паміж рознымі базавымі картамі, а таксама пераключаць слаі карты і катэгорыі кропак цікавасці.
- **Basemaps** are background maps that present the main geographic features of the world. - **Базавыя карты** - гэта фонавыя карты, якія прадстаўляюць асноўныя геаграфічныя аб'екты свету.
Depending on their purpose, basemaps have different styles and levels of detail. У залежнасці ад прызначэння базавыя карты маюць розныя стылі і ўзроўні дэталізацыі.
Only one basemap can be displayed at a time. Адначасова можа быць адлюстравана толькі адна базавая карта.
- **Overlays** are additional layers that can be displayed on top of the basemap to provide complementary information. - **Накладкі** - гэта дадатковыя слаі, якія могуць адлюстроўвацца паверх базавай карты для атрымання дадатковай інфармацыі.
- **Points of interest** can be added to the map to show different categories of places, such as shops, restaurants, or accommodations. - **Кропкі цікавасці** можна дадаць на карту, каб паказаць розныя катэгорыі месцаў, такіх як крамы, рэстараны або жыллё.
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<DocsLayers /> <DocsLayers />
<span class="text-sm text-center mt-2"> <span class="text-sm text-center mt-2">
Hover over the map to show the <a href="https://hiking.waymarkedtrails.org" target="_blank">Waymarked Trails hiking</a> overlay on top of the <a href="https://www.mapbox.com/maps/outdoors" target="_blank">Mapbox Outdoors</a> basemap. Навядзіце курсор мышы на карту, каб паказаць накладанне <a href="https://hiking.waymarkedtrails.org" target="_blank">Пешаходных Сцежак</a> на базавай карце <a href="https://www.mapbox.com/maps/outdoors" target="_blank">Mapbox Outdoors</a>.
</span> </span>
</div> </div>
A large collection of global and local basemaps and overlays is available in **gpx.studio**, as well as a selection of point-of-interest categories. Вялікая калекцыя глабальных і лакальных базавых карт і накладанняў даступная ў **gpx.studio**, а таксама выбар катэгорый кропак цікавасці.
They can be enabled in the [map layer settings dialog](./menu/settings). Іх можна ўключыць у [дыялогавым акне налад слаёў карты](./menu/settings).
In these settings, you can also manage the opacity of the overlays. У гэтых наладах вы таксама можаце кіраваць непразрыстасцю накладанняў.
For advanced users, it is possible to add custom basemaps and overlays by providing <a href="https://en.wikipedia.org/wiki/Web_Map_Tile_Service" target="_blank">WMTS</a>, <a href="https://en.wikipedia.org/wiki/Web_Map_Service" target="_blank">WMS</a>, or <a href="https://docs.mapbox.com/help/glossary/style/" target="_blank">Mapbox style JSON</a> URLs. Для прасунутых карыстальнікаў можна дадаваць карыстальніцкія базавыя карты і накладкі, дадаўшы URL-адрасы <a href="https://en.wikipedia.org/wiki/Web_Map_Tile_Service" target="_blank">WMTS</a>, <a href="https://en.wikipedia.org/wiki/Web_Map_Service" target="_blank">WMS</a> або <a href="https://docs.mapbox.com/help/glossary/style/" target="_blank">JSON у стылі Mapbox</a>.

View File

@@ -10,7 +10,7 @@ title: Edit actions
# { title } # { title }
Unlike the file actions, the edit actions can potentially modify the content of the currently selected files. Unlike the file actions, the edit actions can potentially modify the content of the currently selected files.
Moreover, when the vertical layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, and points of interest](../gpx). Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, and points of interest](../gpx).
Therefore, we will refer to the elements that can be modified by these actions as _file items_. Therefore, we will refer to the elements that can be modified by these actions as _file items_.
Note that except for the undo and redo actions, the edit actions are also accessible through the context menu (right-click) of the file items. Note that except for the undo and redo actions, the edit actions are also accessible through the context menu (right-click) of the file items.
@@ -37,7 +37,7 @@ Create a new track in the selected file.
<DocsNote> <DocsNote>
This action is only available when the vertical layout of the files list is enabled. This action is only available when the tree layout of the files list is enabled.
Additionally, the selection must be a single file. Additionally, the selection must be a single file.
</DocsNote> </DocsNote>
@@ -48,7 +48,7 @@ Create a new segment in the selected track.
<DocsNote> <DocsNote>
This action is only available when the vertical layout of the files list is enabled. This action is only available when the tree layout of the files list is enabled.
Additionally, the selection must be a single track. Additionally, the selection must be a single track.
</DocsNote> </DocsNote>
@@ -67,7 +67,7 @@ Copy the selected file items to the clipboard.
<DocsNote> <DocsNote>
This action is only available when the vertical layout of the files list is enabled. This action is only available when the tree layout of the files list is enabled.
</DocsNote> </DocsNote>
@@ -77,7 +77,7 @@ Cut the selected file items to the clipboard.
<DocsNote> <DocsNote>
This action is only available when the vertical layout of the files list is enabled. This action is only available when the tree layout of the files list is enabled.
</DocsNote> </DocsNote>
@@ -87,7 +87,7 @@ Paste the file items from the clipboard to the current hierarchy level if they a
<DocsNote> <DocsNote>
This action is only available when the vertical layout of the files list is enabled. This action is only available when the tree layout of the files list is enabled.
</DocsNote> </DocsNote>

View File

@@ -3,7 +3,7 @@ title: File actions
--- ---
<script lang="ts"> <script lang="ts">
import { Plus, FolderOpen, Copy, FileX, Download } from 'lucide-svelte'; import { Plus, FolderOpen, Copy, FileX, Download } from '@lucide/svelte';
import DocsNote from '$lib/components/docs/DocsNote.svelte'; import DocsNote from '$lib/components/docs/DocsNote.svelte';
</script> </script>
@@ -29,13 +29,13 @@ You can also drag and drop files directly from your file system into the window.
Create a copy of the currently selected files. Create a copy of the currently selected files.
### <FileX size="16" class="inline-block" style="margin-bottom: 2px" /> Close ### <FileX size="16" class="inline-block" style="margin-bottom: 2px" /> Delete
Close the currently selected files. Delete the currently selected files.
### <FileX size="16" class="inline-block" style="margin-bottom: 2px" /> Close all ### <FileX size="16" class="inline-block" style="margin-bottom: 2px" /> Delete all
Close all files. Delete all files.
### <Download size="16" class="inline-block" style="margin-bottom: 2px" /> Export... ### <Download size="16" class="inline-block" style="margin-bottom: 2px" /> Export...

View File

@@ -3,7 +3,7 @@ title: View options
--- ---
<script lang="ts"> <script lang="ts">
import { ChartArea, GalleryVertical, Map, Layers2, Coins, Milestone, Box } from 'lucide-svelte'; import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box } from 'lucide-svelte';
import DocsNote from '$lib/components/docs/DocsNote.svelte'; import DocsNote from '$lib/components/docs/DocsNote.svelte';
</script> </script>
@@ -15,10 +15,11 @@ This menu provides options to rearrange the interface and the map view.
Hide the elevation profile to make room for the map, or show it to inspect the current selection. Hide the elevation profile to make room for the map, or show it to inspect the current selection.
### <GalleryVertical size="16" class="inline-block" style="margin-bottom: 2px" /> Vertical file list ### <ListTree size="16" class="inline-block" style="margin-bottom: 2px" /> File tree
Switch between a vertical and a horizontal layout for the file list. Toggle the tree layout for the [file list](../files-and-stats).
The [vertical file list](../files-and-stats) is useful when you have many files open, or files with multiple [tracks, segments, or points of interest](../gpx). This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](../gpx) contained inside the files through collapsible sections.
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Switch to previous basemap ### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Switch to previous basemap
@@ -43,6 +44,6 @@ Enter or exit the 3D map view.
<DocsNote> <DocsNote>
To control the orientation and tilt of the map, you can also drag the map while holding <kbd>Ctrl</kbd>. Каб кіраваць арыентацыяй і нахілам карты, вы таксама можаце перацягнуць карту, утрымліваючы <kbd>Ctrl</kbd>.
</DocsNote> </DocsNote>

View File

@@ -4,7 +4,7 @@ title: Toolbar
<script lang="ts"> <script lang="ts">
import Toolbar from '$lib/components/toolbar/Toolbar.svelte'; import Toolbar from '$lib/components/toolbar/Toolbar.svelte';
import { currentTool, Tool } from '$lib/stores'; import { currentTool, Tool } from '$lib/components/toolbar/tools';
import { onMount, onDestroy } from 'svelte'; import { onMount, onDestroy } from 'svelte';
onMount(() => { onMount(() => {

View File

@@ -3,12 +3,12 @@ title: Minify
--- ---
<script> <script>
import { Filter } from 'lucide-svelte'; import { Funnel } from '@lucide/svelte';
import Reduce from '$lib/components/toolbar/tools/Reduce.svelte'; import Reduce from '$lib/components/toolbar/tools/reduce/Reduce.svelte';
import DocsNote from '$lib/components/docs/DocsNote.svelte'; import DocsNote from '$lib/components/docs/DocsNote.svelte';
</script> </script>
# <Filter size="24" class="inline-block" style="margin-bottom: 5px" /> { title } # <Funnel size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
This tool can be used to reduce the number of GPS points in a trace, which can be useful for decreasing its size. This tool can be used to reduce the number of GPS points in a trace, which can be useful for decreasing its size.

View File

@@ -3,8 +3,8 @@ title: Points of interest
--- ---
<script> <script>
import { MapPin } from 'lucide-svelte'; import { MapPin } from '@lucide/svelte';
import Waypoint from '$lib/components/toolbar/tools/Waypoint.svelte'; import Waypoint from '$lib/components/toolbar/tools/waypoint/Waypoint.svelte';
</script> </script>
# <MapPin size="24" class="inline-block" style="margin-bottom: 5px" /> { title } # <MapPin size="24" class="inline-block" style="margin-bottom: 5px" /> { title }

View File

@@ -3,7 +3,7 @@ title: Route planning and editing
--- ---
<script> <script>
import { Pencil, Route, Bike, TriangleAlert, ArrowRightLeft, Home, Repeat, Trash2, CirclePlay, SquareArrowUpLeft } from 'lucide-svelte'; import { Pencil, Route, Bike, TriangleAlert, ArrowRightLeft, House, Repeat, Trash2, CirclePlay, SquareArrowUpLeft } from '@lucide/svelte';
import DocsNote from '$lib/components/docs/DocsNote.svelte'; import DocsNote from '$lib/components/docs/DocsNote.svelte';
import Routing from '$lib/components/toolbar/tools/routing/Routing.svelte'; import Routing from '$lib/components/toolbar/tools/routing/Routing.svelte';
import DocsImage from '$lib/components/docs/DocsImage.svelte'; import DocsImage from '$lib/components/docs/DocsImage.svelte';
@@ -71,7 +71,7 @@ The following tools automate some common route modification operations.
Reverse the direction of the route. Reverse the direction of the route.
### <Home size="16" class="inline-block" style="margin-bottom: 2px" /> Back to start ### <House size="16" class="inline-block" style="margin-bottom: 2px" /> Back to start
Connect the last point of the route with the starting point, using the chosen routing settings. Connect the last point of the route with the starting point, using the chosen routing settings.

Some files were not shown because too many files have changed in this diff Show More