start_mvt_server | R Documentation |
Starts a web server serving vector tiles from a supplied .mbtiles file.
start_mvt_server( tiles_path, host = "0.0.0.0", port = NULL, .serve_mode = "in-memory" )
tiles_path |
The path to an .mbtiles file. |
host |
the host to serve tiles on |
port |
the port to serve tiles on |
.serve_mode |
The way in which the server handles the vector tiles database. "in-memory" is the default and it will read the entire tile database into R as a tibble. "disk" will read tiles from the .mbtiles file as an SQLite database from disk. The default is more performant. Use "disk" only if you have a large vector tileset that would consume too much memory to hold in RAM at once. |
serve_mvt()
is likely more convenient. Only use this if if you want more
control of the host and port on which your tiles are served on.
Where serve_mvt()
verifies the server is actually up and responding, this
funciton does not. So that's up to you to take on.
Note: This server has been built minimising code written, not ' maximising performance. It is intended for local development work, and will likely not be performant enough for any production use-case.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.