Skip to content
This repository was archived by the owner on Sep 10, 2018. It is now read-only.

Previewing changes to the map style

Jesse Crocker edited this page Sep 22, 2016 · 1 revision

The map style is a template that is used to render raster tiles for all of the sources. It changes to the style can be previewed with kosmtik.

  1. Create or download an mbtiles file of vector tiles. A sample file can be downloaded at http://data.openbounds.org/USAHunting/generated/US/MT/deerelklion-2016-2017.pbf.mbtiles

  2. create a file named localconfig.js in the StyleTemplate.tm2 directory. The file should contain the following, but with the url change to the path of the mbtiles file you have downloaded:

    exports.LocalConfig = function (localizer, project) {
        project.mml.source[0] = {
            protocol: "mbtiles:",
            url: "mbtiles:///Users/jesse/downloads/deerelklion-2016-2017.pbf.mbtiles"
        }
        console.log("Style source config:" + JSON.stringify(project.mml.source[0]));
    };
    
  3. cd into the directory where you have kosmtik installed

  4. Install the kosmtik-mbtiles-source plugin, node index.js plugins --install kosmtik-mbtiles-source

  5. Run kosmtik node index.js serve ~/OpenHuntingData/StyleTemplate.tm2/project.yml

Clone this wiki locally