Skip to content

cugos/leaflet-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet Starter

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

  1. Mapbox tileset ID ex: examples.map-h67hf2ic
  2. Data. For testing and playing around, I recommend starting with point data from Natural Earth Data's Populated Places dataset.

##Setup

  1. Get your data into a GeoJSON format, via GDAL cli or QGIS (read more about geojson here).
  2. 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 the data.js file, which is linked to your index.html file.
  3. Instantiate the leaflet API via your site.js file, this is where you'll include your mapbox tileset ID and your geojson data/variable. The site.js is prepared for you already to set up your map in the #map element of your index.html file.

##Woop~!

About

Barebones leaflet application using Mapbox tiles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published