@signalk/charts-plugin 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.prettierignore +1 -0
  2. package/CHANGELOG.md +109 -0
  3. package/README.md +72 -0
  4. package/docs/screenshots/1_overview.png +0 -0
  5. package/docs/screenshots/2_region.png +0 -0
  6. package/docs/screenshots/3_jobs.png +0 -0
  7. package/package.json +13 -8
  8. package/plugin/cacheLayout.d.ts +72 -0
  9. package/plugin/cacheLayout.d.ts.map +1 -0
  10. package/plugin/cacheLayout.js +243 -0
  11. package/plugin/cacheLayout.js.map +1 -0
  12. package/plugin/chartDownloader.d.ts +122 -29
  13. package/plugin/chartDownloader.d.ts.map +1 -1
  14. package/plugin/chartDownloader.js +488 -313
  15. package/plugin/chartDownloader.js.map +1 -1
  16. package/plugin/chartDownloaderMBTilesHelpers.d.ts +10 -0
  17. package/plugin/chartDownloaderMBTilesHelpers.d.ts.map +1 -0
  18. package/plugin/chartDownloaderMBTilesHelpers.js +235 -0
  19. package/plugin/chartDownloaderMBTilesHelpers.js.map +1 -0
  20. package/plugin/chartDownloaderTileHelpers.d.ts +30 -0
  21. package/plugin/chartDownloaderTileHelpers.d.ts.map +1 -0
  22. package/plugin/chartDownloaderTileHelpers.js +277 -0
  23. package/plugin/chartDownloaderTileHelpers.js.map +1 -0
  24. package/plugin/charts.d.ts.map +1 -1
  25. package/plugin/charts.js +23 -5
  26. package/plugin/charts.js.map +1 -1
  27. package/plugin/constants.d.ts.map +1 -1
  28. package/plugin/index.d.ts.map +1 -1
  29. package/plugin/index.js +560 -47
  30. package/plugin/index.js.map +1 -1
  31. package/plugin/pluginStatus.js.map +1 -1
  32. package/plugin/projection.js.map +1 -1
  33. package/plugin/tileServer.d.ts +4 -2
  34. package/plugin/tileServer.d.ts.map +1 -1
  35. package/plugin/tileServer.js +37 -8
  36. package/plugin/tileServer.js.map +1 -1
  37. package/plugin/tokenProvider.d.ts +63 -0
  38. package/plugin/tokenProvider.d.ts.map +1 -0
  39. package/plugin/tokenProvider.js +258 -0
  40. package/plugin/tokenProvider.js.map +1 -0
  41. package/plugin/types.d.ts +37 -2
  42. package/plugin/types.d.ts.map +1 -1
  43. package/public/images/jobs.png +0 -0
  44. package/public/images/overview.png +0 -0
  45. package/public/images/region.png +0 -0
  46. package/public/index.html +392 -113
  47. package/public/js/index.js +620 -0
  48. package/public/leaflet/images/downloads.png +0 -0
  49. package/public/leaflet/images/layers-2x.png +0 -0
  50. package/public/leaflet/images/layers.png +0 -0
  51. package/public/leaflet/images/lifebuoy.png +0 -0
  52. package/public/leaflet/images/spritesheet-2x.png +0 -0
  53. package/public/leaflet/images/spritesheet.svg +156 -0
  54. package/public/leaflet/leaflet.css +677 -0
  55. package/public/leaflet/leaflet.draw.css +253 -0
  56. package/public/leaflet/leaflet.draw.js +2957 -0
  57. package/public/leaflet/leaflet.js +7467 -0
  58. package/public/style.css +351 -37
  59. package/docs/screenshots/1_placeholder.png +0 -0
  60. package/public/index.js +0 -349
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenProvider.js","sourceRoot":"","sources":["../src/tokenProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;AAIH,gEAAgE;AAChE,gDAAgD;AAChD,MAAM,iBAAiB,GAAG,kBAAkB,CAAA;AAC5C,MAAM,iBAAiB,GAAG,6BAA6B,CAAA;AAEvD,mEAAmE;AACnE,qEAAqE;AACrE,sEAAsE;AACtE,sEAAsE;AACtE,0BAA0B;AAC1B,SAAS,SAAS,CAAC,GAAW;IAC5B,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QACtB,OAAO,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,mBAAmB,CAAA;I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,GAAG,KAAK,2CAA2C,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,CAAmC,CAAA;AAC5C,CAAC"}
package/plugin/types.d.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  import type { OutgoingHttpHeaders } from 'http';
2
- type MapSourceType = 'tilelayer' | 'S-57' | 'WMS' | 'WMTS' | 'mapstyleJSON' | 'tileJSON';
2
+ import type { DatabaseSync } from 'node:sqlite';
3
+ export type MapSourceType = 'tilelayer' | 'S-57' | 'WMS' | 'WMTS' | 'mapstyleJSON' | 'tileJSON';
3
4
  export interface MBTilesHandle {
5
+ putTile: (z: number, x: number, y: number, tile: Buffer, callback: (err: Error | null) => void) => void;
6
+ startWriting: (callback: (err: Error | null) => void) => void;
7
+ putInfo: (info: MBTilesMetadata, callback: (err: Error | null) => void) => void;
4
8
  getTile: (z: number, x: number, y: number, callback: (err: Error | null, tile: Buffer, headers: OutgoingHttpHeaders) => void) => void;
5
9
  getInfo: (callback: (err: Error | null, metadata: MBTilesMetadata) => void) => void;
6
10
  close: (callback: (err: Error | null) => void) => void;
7
11
  on: (event: 'error', listener: (err: Error) => void) => MBTilesHandle;
12
+ _db?: DatabaseSync;
8
13
  }
9
14
  export interface MBTilesMetadata {
10
15
  name?: string;
@@ -24,6 +29,10 @@ export interface ChartProvider {
24
29
  _filePath: string;
25
30
  _mbtilesHandle?: MBTilesHandle;
26
31
  _flipY?: boolean;
32
+ _tokenProvider?: {
33
+ ensureFreshToken: () => Promise<void>;
34
+ invalidateToken: () => void;
35
+ };
27
36
  identifier: string;
28
37
  name: string;
29
38
  description: string;
@@ -62,5 +71,31 @@ export interface OnlineChartProvider {
62
71
  style: string;
63
72
  layers: string[];
64
73
  }
65
- export {};
74
+ export interface TokenProviderConfig {
75
+ identifier: string;
76
+ name: string;
77
+ description?: string;
78
+ type?: MapSourceType;
79
+ format?: string;
80
+ scale?: number;
81
+ minzoom?: number;
82
+ maxzoom?: number;
83
+ bounds?: number[];
84
+ tokenEndpoint: {
85
+ url: string;
86
+ method?: 'GET' | 'POST';
87
+ headers?: {
88
+ [key: string]: string;
89
+ };
90
+ body?: string;
91
+ ttlSeconds: number;
92
+ timeoutMs?: number;
93
+ };
94
+ tile: {
95
+ url: string;
96
+ headers?: {
97
+ [key: string]: string;
98
+ };
99
+ };
100
+ }
66
101
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAE/C,KAAK,aAAa,GACd,WAAW,GACX,MAAM,GACN,KAAK,GACL,MAAM,GACN,cAAc,GACd,UAAU,CAAA;AAKd,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,CACP,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,CACR,GAAG,EAAE,KAAK,GAAG,IAAI,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,mBAAmB,KACzB,IAAI,KACN,IAAI,CAAA;IACT,OAAO,EAAE,CACP,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,EAAE,eAAe,KAAK,IAAI,KAC7D,IAAI,CAAA;IACT,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,KAAK,IAAI,CAAA;IAGtD,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,KAAK,aAAa,CAAA;CACtE;AAKD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IA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AAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IAIjB,aAAa,EAAE;QACb,GAAG,EAAE,MAAM,CAAA;QACX,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;QACvB,OAAO,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;QACnC,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;QAIlB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IAKD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KACpC,CAAA;CACF"}
Binary file
Binary file
Binary file
package/public/index.html CHANGED
@@ -1,129 +1,408 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
- <link rel="stylesheet" href="style.css" />
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta
7
+ name="viewport"
8
+ content="width=device-width, initial-scale=1, maximum-scale=1"
9
+ />
5
10
  <title>Signalk charts-addin</title>
6
- </head>
11
+ <link rel="stylesheet" href="style.css" />
12
+ <!-- <script src="js/jquery-3.5.1.min.js"></script> -->
13
+ <!-- <link rel="stylesheet" href="leaflet/leaflet.css" />
14
+ <script src="leaflet/leaflet.js"></script> -->
15
+ <link
16
+ rel="stylesheet"
17
+ href="leaflet/leaflet.css"
18
+ integrity="sha256-NUUnAaVo8SnoYWxXujGmOEPH77UfTAWnMoAdgvk7Llc="
19
+ crossorigin=""
20
+ />
21
+ <script
22
+ src="leaflet/leaflet.js"
23
+ integrity="sha256-+Vr0Lt/cDlE+ps7z+a656+YmyuGPiju0p3DfhReTI/w="
24
+ crossorigin=""
25
+ ></script>
7
26
 
27
+ <link rel="stylesheet" href="leaflet/leaflet.draw.css" />
28
+ <script src="leaflet/leaflet.draw.js"></script>
29
+ </head>
8
30
  <body>
9
- <fieldset>
10
- <legend>Seed charts to prefetch tiles for offline usage.</legend>
11
- <strong>Select chart provider:</strong><br />
12
- <label for="chart">Chart:</label>
13
- <select id="chart" name="chart" required></select>
14
- <br />
15
- <strong>Select region type:</strong>
16
- <br />
17
- <!-- Choice 1: Predefined Region -->
18
- <label>
19
- <input type="radio" name="inputType" value="region" checked />
20
- Region
21
- </label>
22
- <select id="region" name="region"></select>
31
+ <div id="map" style="width: 100%; height: 100vh"></div>
23
32
 
24
- <br />
33
+ <div id="jobsModal" class="modal hidden">
34
+ <div class="modal-content">
35
+ <div class="modal-header">
36
+ <h3>Job Progress</h3>
37
+ <button id="closeJobsModal" onclick="toggleJobsModal()">✖</button>
38
+ </div>
25
39
 
26
- <!-- Choice 2: Bounding Box -->
27
- <label>
28
- <input type="radio" name="inputType" value="bbox" />
29
- Bounding Box (minLon, minLat, maxLon, maxLat) West to East, South to
30
- North
31
- </label>
32
- <div>
33
- <input
34
- type="number"
35
- id="bboxMinLon"
36
- placeholder="minLon"
37
- step="0.0001"
38
- disabled
39
- value="16.51"
40
- />
41
- <input
42
- type="number"
43
- id="bboxMinLat"
44
- placeholder="minLat"
45
- step="0.0001"
46
- disabled
47
- value="58.59"
48
- />
49
- <input
50
- type="number"
51
- id="bboxMaxLon"
52
- placeholder="maxLon"
53
- step="0.0001"
54
- disabled
55
- value="16.60"
56
- />
57
- <input
58
- type="number"
59
- id="bboxMaxLat"
60
- placeholder="maxLat"
61
- step="0.0001"
62
- disabled
63
- value="58.65"
64
- />
40
+ <div id="jobsScroll">
41
+ <div id="jobsGrid" class="job-cards"></div>
42
+ </div>
43
+ <span id="noJobsMessage" class="hidden"
44
+ >No jobs added, click on region to add seeding job</span
45
+ >
46
+ <template id="job-card-template">
47
+ <div class="job-card">
48
+ <div class="job-card-header">
49
+ <div>
50
+ <strong class="job-region"></strong>
51
+ <div class="job-chart"></div>
52
+ </div>
53
+ <button class="job-remove" title="Remove job from this list">
54
+ &times;
55
+ </button>
56
+ </div>
57
+
58
+ <div class="job-status"></div>
59
+ <div class="job-card-progress"></div>
60
+
61
+ <div class="job-card-stats-actions">
62
+ <div class="job-card-stats">
63
+ <div>Total: <span class="job-total"></span></div>
64
+ <div class="job-seed hidden">
65
+ <div>Downloaded: <span class="job-downloaded"></span></div>
66
+ <div>Cached: <span class="job-cached"></span></div>
67
+ <div>Failed: <span class="job-failed"></span></div>
68
+ </div>
69
+ <div class="job-delete hidden">
70
+ <div>Deleted: <span class="job-deleted"></span></div>
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </template>
65
76
  </div>
66
- <!-- Choice 3: Tile -->
67
- <!-- <label>
68
- <input type="radio" name="inputType" value="tile">
69
- Tile (x, y, z)
70
- </label>
71
- <div>
72
- <input type="number" id="tileX" placeholder="x" disabled>
73
- <input type="number" id="tileY" placeholder="y" disabled>
74
- <input type="number" id="tileZ" placeholder="z" disabled>
75
- </div> -->
77
+ </div>
76
78
 
77
- <strong>Select max zoom:</strong><br />
78
- <label for="maxZoom">Max Zoom</label>
79
- <select id="maxZoom" name="maxZoom" required>
80
- <option value="4">4</option>
81
- <option value="5">5</option>
82
- <option value="6">6</option>
83
- <option value="7">7</option>
84
- <option value="8">8</option>
85
- <option value="9">9</option>
86
- <option value="10">10</option>
87
- <option value="11">11</option>
88
- <option value="12">12</option>
89
- <option value="13">13</option>
90
- <option value="14">14</option>
91
- <option value="15" selected="selected">15</option>
92
- <option value="16">16</option>
93
- <option value="17">17</option>
94
- <option value="18">18</option>
95
- <option value="19">19</option>
96
- <option value="20">20</option>
97
- </select>
79
+ <div id="regionModal" class="modal hidden">
80
+ <div class="modal-content" style="max-width: fit-content">
81
+ <div class="modal-header">
82
+ <h3>Edit Region Job</h3>
83
+ <button id="cancelRegion" onclick="closeRegionModal()">✖</button>
84
+ </div>
85
+ <fieldset>
86
+ <legend>Region Information</legend>
87
+ <label for="regionName"><strong>Region Name:</strong></label>
88
+ <input type="text" id="regionName" oninput="updateRegionButtons()" />
89
+ <button id="saveRegion" class="btn btn--primary">Save</button>
90
+ </fieldset>
98
91
 
99
- <br />
100
- <button id="createJobButton">Create Seeding Job</button>
101
- </fieldset>
92
+ <fieldset>
93
+ <legend>Seed charts to prefetch tiles for offline usage.</legend>
94
+ <label for="chartSelect"
95
+ ><strong>Select chart provider:</strong></label
96
+ >
97
+ <select id="chartSelect" name="chartSelect" required></select>
102
98
 
103
- <div id="output">
104
- <table id="activeJobsTable" aria-live="polite">
105
- <thead>
106
- <tr>
107
- <th>#</th>
108
- <th>Chart</th>
109
- <th>Region</th>
110
- <th>Total tiles</th>
111
- <th>Downloaded</th>
112
- <th>Cached</th>
113
- <th>Failed</th>
114
- <th>Progress</th>
115
- <th>Status</th>
116
- <th>Actions</th>
117
- </tr>
118
- </thead>
119
- <tbody>
120
- <tr>
121
- <td colspan="7" class="muted">Loading progress…</td>
122
- </tr>
123
- </tbody>
124
- </table>
99
+ <label for="minZoom"><strong>Min Zoom:</strong></label>
100
+ <input type="number" id="minZoom" min="0" max="22" value="1" />
101
+
102
+ <label for="maxZoom"><strong>Max Zoom:</strong></label>
103
+ <input type="number" id="maxZoom" min="0" max="22" value="15" />
104
+
105
+ <strong>Options:</strong><br />
106
+ <input type="checkbox" id="refetch" name="refetch" value="refetch" />
107
+ <label for="refetch"> Refresh all tiles</label><br />
108
+ <input type="checkbox" id="mbtiles" name="mbtiles" value="mbtiles" />
109
+ <label for="mbtiles"> Create a separate mbtiles for this region</label
110
+ ><br />
111
+ <input type="checkbox" id="vacuum" name="vacuum" value="vacuum" />
112
+ <label for="vacuum"> Compact file after seeding</label><br />
113
+ <button
114
+ id="createJobButton"
115
+ class="btn btn--primary"
116
+ disabled
117
+ onclick="createJob('start')"
118
+ >
119
+ Create Seeding Job
120
+ </button>
121
+ <button
122
+ id="deleteButton"
123
+ class="btn btn--danger"
124
+ type="button"
125
+ disabled
126
+ onclick="createJob('delete')"
127
+ >
128
+ Delete Cached Tiles for this region
129
+ </button>
130
+ </fieldset>
131
+ <span id="response" class="hidden"
132
+ >New seeding job added, Click jobs to view details</span
133
+ >
134
+ </div>
135
+ </div>
136
+
137
+ <div id="help" class="modal hidden">
138
+ <div class="modal-content" style="max-width: fit-content">
139
+ <div class="modal-header">
140
+ <h1 id="using-the-chart-plugin">Using the Chart Plugin</h1>
141
+ <button id="closeHelpModal" onclick="toggleHelpModal()">✖</button>
142
+ </div>
143
+
144
+ <h2 id="overview">Overview</h2>
145
+ <p>
146
+ The graphical interface provides several tools for navigating the
147
+ chart, defining cache regions, and managing chart data. The buttons
148
+ highlighted in the interface correspond to the main controls available
149
+ to the user.
150
+ </p>
151
+ <p><img src="images/overview.png" alt="Main UI" /></p>
152
+ <h3 id="zoom-controls">Zoom Controls</h3>
153
+ <p>
154
+ The <strong>Zoom In (+)</strong> and
155
+ <strong>Zoom Out (−)</strong> buttons allow the user to change the map
156
+ scale.
157
+ </p>
158
+ <ul>
159
+ <li>
160
+ <p>
161
+ <strong>Zoom In (+)</strong><br />Increases the zoom level to
162
+ display more detailed chart information.
163
+ </p>
164
+ </li>
165
+ <li>
166
+ <p>
167
+ <strong>Zoom Out (−)</strong><br />Decreases the zoom level to
168
+ show a larger geographic area.
169
+ </p>
170
+ </li>
171
+ </ul>
172
+ <p>
173
+ These controls behave similarly to standard map applications. Zooming
174
+ can also be performed using the mouse scroll wheel.
175
+ </p>
176
+ <h3 id="region-creation-tools">Region Creation Tools</h3>
177
+ <p>
178
+ The region creation tools allow the user to define areas of the map
179
+ for chart caching.
180
+ </p>
181
+ <ul>
182
+ <li>
183
+ <p>
184
+ <strong>Create Rectangular Region</strong><br />Enables the user
185
+ to draw a rectangular area on the chart. This region defines the
186
+ boundaries where chart data should be cached.
187
+ </p>
188
+ </li>
189
+ <li>
190
+ <p>
191
+ <strong>Create Polygon Region</strong><br />Allows the user to
192
+ draw a custom polygon by placing multiple points on the map. This
193
+ is useful when the area of interest does not fit a simple
194
+ rectangle.
195
+ </p>
196
+ </li>
197
+ </ul>
198
+ <p>
199
+ These regions determine which chart tiles or map data will be included
200
+ in the cache.
201
+ </p>
202
+ <h3 id="region-editing-tools">Region Editing Tools</h3>
203
+ <p>
204
+ Once regions are created, they can be modified using the editing
205
+ tools.
206
+ </p>
207
+ <ul>
208
+ <li>
209
+ <p>
210
+ <strong>Edit Region</strong><br />Allows the user to modify an
211
+ existing region by adjusting its shape or vertices.
212
+ </p>
213
+ </li>
214
+ <li>
215
+ <p>
216
+ <strong>Delete Region</strong><br />Removes the selected region
217
+ from the map.
218
+ </p>
219
+ </li>
220
+ </ul>
221
+ <h3 id="active-seeding-jobs">Active Seeding Jobs</h3>
222
+ <p>
223
+ The <strong>Active Seeding Jobs</strong> button displays currently
224
+ running caching or seeding processes.
225
+ </p>
226
+ <p>
227
+ From this panel, users can monitor the progress of jobs that are
228
+ downloading or preparing chart data for offline use.
229
+ </p>
230
+ <h3 id="chart-layers">Chart Layers</h3>
231
+ <p>
232
+ The <strong>Chart Layers</strong> button opens a layer selection menu.
233
+ </p>
234
+ <p>
235
+ Users can enable or disable different chart layers to control what
236
+ information is visible on the map. Only chart layers that support
237
+ proxy will be visible in this menu.
238
+ </p>
239
+ <h3 id="help">Help</h3>
240
+ <p>
241
+ The <strong>Help</strong> button opens the help overlay shown in the
242
+ interface.
243
+ </p>
244
+ <p>
245
+ This overlay provides a quick visual guide explaining the available
246
+ controls and their functions.
247
+ </p>
248
+ <h2 id="region-job-configuration">Region Job Configuration</h2>
249
+ <p>
250
+ The <strong>Edit Region Job</strong> dialog allows users to configure
251
+ caching (seeding) settings for a selected region. Seeding downloads
252
+ chart tiles for the defined region so they are available locally for
253
+ offline use.
254
+ </p>
255
+ <p><img src="images/region.png" alt="Region" /></p>
256
+ <h3 id="region-information">Region Information</h3>
257
+ <p>
258
+ <code>Region Name</code> field defines the name of the selected
259
+ region. This name is used to identify the region in the interface and
260
+ in the list of configured jobs.
261
+ </p>
262
+ <p>
263
+ <code>Save:</code> button stores any changes made to the region name.
264
+ </p>
265
+ <h3 id="chart-seeding-configuration">Chart Seeding Configuration</h3>
266
+ <p>
267
+ This section configures how chart tiles will be downloaded and stored
268
+ for the selected region.
269
+ </p>
270
+ <p>
271
+ <code>Select Chart Provider:</code> dropdown allows the user to choose
272
+ which chart source should be used when downloading tiles. Different
273
+ providers may supply different chart styles or datasets depending on
274
+ the configured system.
275
+ </p>
276
+ <p>
277
+ <code>Minimum Zoom:</code> value defines the lowest zoom level that
278
+ will be downloaded. Lower zoom levels cover larger geographic areas
279
+ with fewer tiles and are useful for viewing charts while zoomed far
280
+ out.
281
+ </p>
282
+ <p>
283
+ <code>Maximum Zoom:</code> value defines the highest zoom level that
284
+ will be downloaded. Higher zoom levels contain more detailed chart
285
+ data but require significantly more tiles and storage space.
286
+ </p>
287
+ <h4 id="options">Options</h4>
288
+ <p>
289
+ <code>Refresh All Tiles</code> If enabled, the seeding process will
290
+ re-download tiles even if they already exist in the cache. This is
291
+ useful when charts have been updated and the local cache needs to be
292
+ refreshed.
293
+ </p>
294
+ <p>
295
+ <code>Create a Separate MBTiles for This Region:</code> When enabled,
296
+ all tiles downloaded for this region will be copied to a dedicated
297
+ MBTiles database file. First the tiles will be downloaded to the
298
+ global cache, once the download is complete a new mbtiles file will be
299
+ created to include the downloaded tiles.
300
+ </p>
301
+ <p>This can be useful for:</p>
302
+ <ul>
303
+ <li>Sharing maps with outher sailors</li>
304
+ <li>
305
+ Creating offline maps to be used by other chart plotter software,
306
+ e.g. OpenCPN
307
+ </li>
308
+ </ul>
309
+ <p>
310
+ <code>Compact File After Seeding</code> If this option is enabled, the
311
+ MBTiles database will be compacted after the seeding process finishes.
312
+ Compaction reduces file size and improves storage efficiency by
313
+ cleaning up unused database space created during the tile download
314
+ process.
315
+ </p>
316
+ <p>
317
+ ⚠️ <strong>Warning:</strong> This will temporarily create a new
318
+ mbtiles file and copy the tiles to the new database. You must have
319
+ enough diskspace to perform this operation.
320
+ </p>
321
+ <h4 id="actions">Actions</h4>
322
+ <p>
323
+ <code>Create Seeding Job</code> button starts a caching job for the
324
+ selected region using the configured settings. The job will download
325
+ all tiles required for the region between the selected minimum and
326
+ maximum zoom levels. Progress and status information can be monitored
327
+ in the Job Progress panel.
328
+ </p>
329
+ <p>
330
+ <code>Delete Cached Tiles for This Region:</code> button removes all
331
+ cached tiles associated with the selected region. This operation frees
332
+ storage space from the mbtiles but not necesarily the diskspace.
333
+ </p>
334
+ <p>
335
+ ⚠️ <strong>Warning:</strong> This action permanently deletes the
336
+ cached data for the region.
337
+ </p>
338
+ <p>
339
+ ⚠️ <strong>Warning:</strong> Eventhough the tiles are removed from the
340
+ cache, the database size on disk will not shrink due to how sqlite
341
+ database are managed. Use compact file after seeding option to free
342
+ the diskspace.
343
+ </p>
344
+ <h2 id="job-progress">Job Progress</h2>
345
+ <p>
346
+ The Job Progress dialog displays the status of active chart seeding
347
+ jobs.<br />Each job represents a task that downloads chart tiles for a
348
+ defined region so they are available for offline use. Jobs are
349
+ ephemeral: If the signalk server is restarted these jobs will also be
350
+ removed, but the cached tiles will remain in the cache.
351
+ </p>
352
+ <p><img src="images/jobs.png" alt="Region" /></p>
353
+ <hr />
354
+ <h3 id="job-information">Job Information</h3>
355
+ <p>Each job card provides a summary of the seeding operation.</p>
356
+ <p>
357
+ <code>Region:</code> field shows the name of the region associated
358
+ with the job.<br />This corresponds to the region defined during the
359
+ region creation or editing process. The line below the region name
360
+ indicates the chart provider being used to download tiles.
361
+ </p>
362
+ <p>
363
+ <code>Job Status:</code> indicates the current activity of the job.
364
+ Possible statuses are: <strong>Seeding</strong> – Tiles are currently
365
+ being downloaded. and - <strong>Completed</strong> – The job has
366
+ finished successfully.
367
+ </p>
368
+ <p>
369
+ <code>Progress Bar:</code> visually represents how much of the job has
370
+ been completed. The percentage shown next to the bar indicates the
371
+ proportion of tiles processed relative to the total number of tiles
372
+ required for the region and zoom levels.
373
+ </p>
374
+ <p>
375
+ Each job displays several counters that provide detailed information
376
+ about the seeding process.
377
+ </p>
378
+ <p>
379
+ <code>Total:</code> Indicates an estimate of the total number of tiles
380
+ that must be processed for the job with up to %10 error depending on
381
+ the size and shape of the region.
382
+ </p>
383
+ <p>
384
+ <code>Downloaded:</code> Represents the number of tiles successfully
385
+ retrieved from the chart provider during the current seeding process.
386
+ </p>
387
+ <p>
388
+ <code>Cached:</code> Indicates the number of tiles that were already
389
+ present in the cache and did not need to be downloaded again. This can
390
+ occur when seeding overlaps with previously cached data.
391
+ </p>
392
+ <p>
393
+ <code>Failed:</code> Represents the number of tiles that could not be
394
+ downloaded due to network errors, provider issues, or other failures.
395
+ </p>
396
+ <h3 id="job-controls">Job Controls</h3>
397
+ <p>
398
+ <code>Cancel Job:</code> Each job card contains a
399
+ <strong>Cancel (×)</strong> button in the upper corner. Pressing this
400
+ button stops the seeding process for that job. Any tiles that were
401
+ already downloaded will remain in the cache.
402
+ </p>
403
+ </div>
125
404
  </div>
126
405
 
127
- <script src="index.js"></script>
406
+ <script src="js/index.js"></script>
128
407
  </body>
129
408
  </html>