[GIS] installing geojson-vt with Leaflet

geojsonleafletvector-tiles

I need help using the leaflet plugin geojson-vt. According to tutorials, like this one on http://bl.ocks.org/Sumbera/c67e5551b21c68dc8299, there should be a js file called geojson-vt-dev.js. When I download the zipfile from GitHub I get 6 different js files in the src folder: clip.js, convert.js, index.js, simplify.js, tile.js, wrap.js.

Can anyone help me figure out what I am doing wrong?

This page; http://www.paulcflynn.com/projection_picker.html is ultimately what I am trying to speed by using vector tiles. Loading the GeoJSONs straight in leaflet was fine, but now I need to add more vector files, which reduce performance significantly.

Best Answer

Check out the section named Browser Builds on the GitHub page. It shows you how to use npm to build a development or minified production build.

I just tried npm run build-dev and the output is named geojson-vt-dev.js

Assuming you have git installed, here are the steps:

  1. git clone https://github.com/mapbox/geojson-vt.git
  2. change into the geojson-vt directory
  3. npm install
  4. npm run build-dev
Related Question