A map widget for Impact Working Group #omgkrk
Create .env
file with MAPBOX_ACCESS_TOKEN=token
npm install
npm start
npm run build
You should have now main.[hash].js
in the ./dist
directory.
You can use a widget in any html page like that:
<script src="path-to-generated-main-js-bundle"></script>
Or you can deploy example to Github Pages:
npm run deploy
- Generate geojson file using csv file. Data needed: id, latitude, longitude
npm run generate-geojson ~/path-to-the.csv
Generated geojson file should be in ./data
directory.
- Upload geojson to the Mapbox Studio as dataset.
- Create a tileset from this dataset.
- Add a layer with this tileset/dataset in the custom style.
- Update ./src/Config.js -
style
,sourceLayer
(dataset name),layerName
(layer name you added to the style) - Make sure that you use correct
accessToken
(placed in.env
asMAPBOX_ACCESS_TOKEN=token
)