Tuktuk chart plotter with SignalK and MBTiles support
npm install tuktuk-chart-plotterChart plotter for Signal K with the support for raster chart providers.
Very much _WIP_.
|
Install "Tuktuk chart plotter" webapp from the Signal K Appstore together
with @signalk/charts-plugin.
Configure charts plugin to server some charts and open the Tuktuk chart plotter in .
Some example MBTiles charts can be found from:
- Finnish nautical charts: https://github.com/vokkim/rannikkokartat-mbtiles
- NOAA charts: https://github.com/vokkim/noaa-nautical-charts
Install dependencies:
npm install
Running tests (only eslint for now):
npm run test
Start development server:
npm run watch
Plotter accessible at http://localhost:4999/
To see actual data, you should have a signalk-server-node
running and maybe some charts.
Tuktuk uses uses eslint and Prettier
to enforce and format code style. To auto-format the code run:
npm run lint-fix
**Tuktuk ships with a local server intended for development use only.
For production use, please install Tuktuk as a Signal K Webapp**
- PORT = server port, default 4999
- CHARTS_PATH = location for chart files (.mbtiles), default charts/
- CLIENT_CONFIG_FILE = client config file, default client-config.json
- When the plotter is ran with a local server using npm run start or npm run watch, the browser will receive a configuration file defined by the CLIENT_CONFIG_FILE environment variable.
- When the plotter is accessed through Signal K server plugin, the browser will use default Signal K configration defined in public/index.html
Example config:
`` javascript`
{
"data": [
{
"type": "signalk",
"address": "localhost:3000"
}
],
"course": "COG",
"follow": true,
"showInstruments": true,
"zoom": 13,
"charts": [
{
"index": 0,
"type": "tilelayer",
"maxzoom": 15,
"minzoom": 4,
"name": "liikennevirasto_rannikkokartat_public_15_4",
"description": "Lähde: Liikennevirasto. Ei navigointikäyttöön. Ei täytä virallisen merikartan vaatimuksia.",
"tilemapUrl": "/charts/liikennevirasto_rannikkokartat_public_15_4/{z}/{x}/{y}",
"bounds": [19.105224609375, 59.645540251443215, 27.88330078125, 65.84776766596988],
"center": [24.805, 60.0888]
}
]
}
Chart plotter is designed to work with Signal K:
- Install and run signalk-server-node
- Add signalk data provider to client-config.json:` javascript`
"data": [
{
"type": "signalk",
"address": "localhost:3000"
}
]
...
To use the Geolocation API, add geolocation provider:` javascript`
"data": [
{
"type": "geolocation"
}
]
...
Put charts in MBTiles format to your CHARTS_PATH..mbtiles
Files must end with postfix. Charts found by the chart plotter are listed in http://localhost:4999/charts/.
Local charts are configured in client-config.json by adding local chart provider:` javascript`
...
"charts": [
{
"index": 0,
"type": "local"
}
]
...
Map tiles hosted by Signal K server are configured in client-config.json by adding signalk chart provider:` javascript`
...
"charts": [
{
"index": 2,
"type": "signalk",
"address": ":3000"
}
]
...
Other charts in client-config.json are of type tilelayer:` javascript``
"charts": [
{
"index": 1,
"type": "tilelayer",
"maxzoom": 15,
"minzoom": 1,
"name": "OpenStreetMap",
"description": "OSM charts.",
"tilemapUrl": "http://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
}
]
MIT