Community map template
This is a simple template for a pin-based map that draws its content from a public Google Sheets worksheet.
Project setup
yarn install
- Change the project name in package.json
- Get an account on Mapbox, and replace the public token in Map.vue with your public token
Using a Google Sheet for data
This project starts using data in https://docs.google.com/spreadsheets/d/1DFXQYOh2CRZbFtMAFNbVJwpWQxx_SUhPr56OYaDLWS0/edit?usp=sharing
- Duplicate this Google Sheet and use it as a template.
- Under File, "Publish to the web", as CSV.
- Put the CSV link in Map.vue.
Special columns
The template recognises certain column names by default. Obviously you can change these in the code.
Longitude
,Latitude
Name
: title of feature info panelDescription
: smaller text in feature info panelImage_Url
:
Running locally
npm run serve
Publishing to Github
- Set up a Github repo (or fork the original source)
- Push an initial commit
- Run
yarn run deploy
- Now configure Github Pages to use
docs
directory
Customising
There aren't many components.
- App.vue: Overall structure of the site
- FeatureInfo.vue: Information shown when you click on something
- Map.vue: Initialises the map and adds stuff to it.