Barebones application needed for building a Leaflet webmap with GeoJSON data. This specific example uses Mapbox's tilesets which can be obtained by creating an account at mapbox.com.
##What you'll need
- Mapbox tileset ID ex:
examples.map-h67hf2ic
- Data. For testing and playing around, I recommend starting with point data from Natural Earth Data's Populated Places dataset.
##Setup
- Get your data into a GeoJSON format, via GDAL cli or QGIS (read more about geojson here).
- Take the raw text of that GeoJSON data and add it to a javascript variable in a separate
.js
file - this is done for you here in thedata.js
file, which is linked to yourindex.html
file. - Instantiate the leaflet API via your
site.js
file, this is where you'll include your mapbox tileset ID and your geojson data/variable. Thesite.js
is prepared for you already to set up your map in the#map
element of yourindex.html
file.
##Woop~!