Getting Started¶
Tileviewer can be run according to your needs. Here are the two most common ways to run it.
Bundled into TileMaker¶
Most users should choose to use the TileMaker software to streamline their workflow. TileMaker allows users to create and serve data from a SQL database that is compatible with TileViewer. The service is built and served by FastAPI, which conveniently can bundle and serve the TileViewer user interface as well. Follow its documentation to get up and running with this approach.
Run Both Tilemaker and Tileviewer Locally¶
This approach makes the most sense when developing or contributing to the TileViewer software. In this approach, we will clone TileViewer and use Vite to run it locally while pointing it to a locally-run tile service as well.
Clone and initialize
TileViewer
git clone git@github.com:simonsobs/tileviewer.git
cd tileviewer
npm install
Create a
.env.developmentfile by copying the contents from.env.development.sample. You may need to amend theVITE_SERVICE_URLdepending on what port your tile server actually runs on.Depending on your tile server setup:
3A. If using
TileMaker:Clone the repo and follow its README instructions for generating data and running the server.
Amend the
settings.pyfile as follows:
# vite's dev server is configured to be on port 8080; amend as desired. origins: list[str] | None = ["http://localhost:8080"] add_cors: bool = True
Run the tile server locally via
tilemaker serve --port=9191(if you set a different port in the.env.developmentfile, then match it accordingly)
3B. If using your own tile server:
Set the
VITE_SERVICE_URLenvironment variable in.env.developmentto point to your local serverRun your tile server locally
Run the client dev server via
npm run devand open a browser with the localhost URL shown in the console.