How to use custom map styles in MapTiler Server (export from Cloud)

This article shows how to export custom map styles from MapTiler and how to work with these custom styles in MapTiler Server. Map styles generated in MapTiler are specific and use some resources that are usually not available in the air-gapped environment of MapTiler Server. Therefore some adjustments to the style are usually required. This article will give all the necessary information about the adjustment and deployment process for your custom map styles.

Create a custom map style

In MapTiler maps, you can adjust colors, change languages, apply preferred country borders, and change fonts. For detailed help, see the map design basics tutorial.

Please note that not all map fonts are supported by MapTiler Server. Select one of the following fonts to make sure that custom styles will be 100% reflected in MapTiler Server:

  • Noto Sans: Bold, Italic, and Regular
  • Metropolis: Semi Bold and Semi Bold Italic
  • Roboto: Regular, Medium,
  • Roboto Condensed: Regular, and Italic

MapTiler Free plan allows only five custom map styles. For more custom styles, please upgrade to MapTiler FLEX plan

Download your custom style

Find your custom map style under “My Maps” and select it. Click the 3 dots button and select “Download Style”. This will download the map style as a zip file.

Group 1 (8).png

Import style to MapTiler Server

To get help with setting up MapTiler Server and uploading free test data, see the Getting started tutorial. 

Once you have your MapTiler Server running, go to page Datasets and click on the details button of previously downloaded OpenStreetMap or MapTiler Planet data. Press on “Change ID” to see the ID of the tiles and copy the name.

Screenshot_2023-02-21_at_18.10.22.png

What you need to do now, is to replace that ID in the style.json file of your Custom Map Style.

Unzip the Map Style and open the style.json file.

The current URL path is pointing out to API which needs to be replaced. We need to reference locally served sources (the tiles ID you copied before). You need to do is to add “#” before the name.

Screenshot_2023-02-21_at_18.36.48.png

The second change that needs to be done in the JSON file (bottom of the file) is to replace the path for “glyphs” with”#”, so all requested font files will be served from the local directory.

Depending on the Map Style, sometimes Sprite files are being generated. In this case, you need to replace the path for “sprite” with “#” as well.

Screenshot_2023-02-22_at_12.22.36.png

Save the changes in the JSON file. Now select all the files inside of the previously unzipped file (style.json and LICENSE.txt) and zip the files again. Now drag and drop the zip file into the MapTiler Server and use your custom map style.

Screenshot 2023-08-17 at 12.20.29.png

Get started with MapTiler Server Add data to MapTiler Server
Work with map styles in MapTiler Server