https://github.com/mit-spatial-action/svelte-map-app
Svelte template for an Mapbox-based application that includes common functionality geocoding, add marker on click, active location state management).
https://github.com/mit-spatial-action/svelte-map-app
Last synced: about 1 year ago
JSON representation
Svelte template for an Mapbox-based application that includes common functionality geocoding, add marker on click, active location state management).
- Host: GitHub
- URL: https://github.com/mit-spatial-action/svelte-map-app
- Owner: mit-spatial-action
- Created: 2023-07-26T17:27:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-16T16:56:32.000Z (over 2 years ago)
- Last Synced: 2024-02-16T20:27:41.882Z (over 2 years ago)
- Language: Svelte
- Size: 235 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# svelte-map-app

This is a simple templated mapping application, built using Svelte, SvelteKit, Node, Bulma, and Mapbox that can be easily customized using the fields in `src/config/instance.json`. It includes basic, but common, documentation pages, which can be written in markdown, and the map allows the user to select locations using click events or forward geocoding, which populate a bare-bones info panel.
## Configuration
### Node
Assuming you have node installed, you can install all dependencies by running `npm install` from the root directory.
### MapBox Token
For the application to run, you'll need a MapBox token. The application expects it to be stored in a `.env` file in the root directory. E.g., this file should look like...
```
MAPBOX_TOKEN='your token here`
```
Important note: the token _will be exposed to the client_! As such, before deploying, you should make sure that your token is appropriately scoped and that it has URL restrictions in place.
## Running
Run `npm run css-build && npm run dev` from the root folder. (On subsequent runs, you can simply run `npm run dev`. This starts a vite server (`vite dev`) and a node-sass watcher that watches for changes in `src/styles/style.scss` (the latter supports rapid Bulma development).