Skip to content

How Can I Create Custom Tiles?

Will Granger edited this page Sep 3, 2020 · 8 revisions

How Can I Create Custom Tiles?

Creating custom .mbtiles for a mapping library like Leaflet to consume may seem daunting, but there are many tools available to make the process easy and painless.

The steps below outline how to create custom vector tiles for a particular use case: taking lat/lng coordinates that correspond to polygons, converting that to a custom map layer of shapes, merging that with an existing base map, and creating a new .mbtiles layer.

  1. (If converting data into vector shapes) Parse lat/lng data into GeoJSON using a script
  2. Convert GeoJSON from previous step into MbTiles with Tippecanoe
  3. Download base map tiles from OpenMapTiles
    • As of this writing, base map layers are free to download for open-source projects, and are otherwise available for purchase
  4. Use Tippecanoe’s tile-join to merge tiles created in step 2 above with base map tiles downloaded in step 3
  5. You can edit joined tiles from the previous step using Mapbox studio (login required).
    • This allows you to edit all aspects of the map, including what layers are visible and the colors of different items on the map
    • Once you're satisfied with how the tiles look, export them from Mapbox studio
  6. Test out your .mbtiles using tileserver-gl
    • I recommend using the command-line tool to test everything looks as expected.
    • You can also use this tool to make sure your .mbtiles appear as expected for any other steps in this process

Additional Info:

Clone this wiki locally