tile_viewer {tiler} | R Documentation |
Create an HTML tile preview
Description
Create an HTML file that displays a tile preview using Leaflet.
Usage
tile_viewer(tiles, zoom, width = NULL, height = NULL, georef = TRUE, ...)
Arguments
tiles |
character, directory where tiles are stored. |
zoom |
character, zoom levels full range. Example format: |
width |
|
height |
|
georef |
logical, for non-geographic tiles only. If |
... |
additional optional arguments include |
Details
This function creates a file preview.html
adjacent to the tiles
base
directory. When loaded in the browser, this file displays map tiles from the
adjacent folder. For example, if tiles are stored in project/tiles
, this
function creates project/preview.html
.
By default, tile()
creates this file. The only reasons to call
tile_viewer()
directly after producing map tiles are: (1) if
viewer = FALSE
was set in the call to tile()
, (2) if tile()
was called
multiple times, e.g., for different batches of zoom levels, and thus the most
recent call did not use the full zoom range, or (3) preview.html
was
deleted for some other reason.
If calling this function directly, ensure that the min and max zoom, and
original image pixel dimensions if applicable, match the generated tiles.
These arguments are passed to tile_viewer} automatically when called within
tile(), based on the source file provided to
tile()'.
Value
nothing is returned, but a file is written to disk.
See Also
Examples
tile_viewer(file.path(tempdir(), "tiles"), "3-7") # requires existing tiles