How to use custom map styles in MapTiler Server (export from Cloud)
This article shows how to export custom map styles from MapTiler Cloud and how to work with these custom styles in MapTiler Server. Map styles generated in MapTiler Cloud 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.
How to create your MapTiler account?
Go to the MapTiler webpage and click on the “CREATE FREE ACCOUNT” button in the middle-top .
To create your account, choose between the options: “Sign in with email” or “Sign in with Google.”
How to create a custom style in MapTiler Cloud
Once you are logged in, tap on “New Map” in the top right corner. We prepared beautiful map styles for you, but you can customize them your way!
Select Map Style from Streets, Satellite Hybrid, Basic, or Outdoor, and press “Customize”. Some of the map styles have different modes available, like dark or light. Those modes can be found at the bottom.
(Basic map style from MapTiler with adjusted colors)
MapTiler Customize tool enables you to adjust the cartography to your liking. You can adjust colors, change languages, apply preferred country borders, and change fonts.
When you are done with your customizing the map style your way, hit SAVE at the top bar and save the map by giving it a new name.
Not all fonts are supported by MapTiler Server at the moment. Please choose only from 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 Cloud Free plan allows only five custom map styles. For more custom styles, please upgrade to MapTiler Cloud FLEX plan.
How to create a custom style in MapTiler Cloud
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.
How to import your map style into the MapTiler Server
If you need help installing MapTiler Server software, please head to those pages to install it for Windows, macOS, Linux, and Docker.
In order for your Map Styles to work, you need some data to connect the map styles with.
This data can be found in the free “Map Styles” package that we are offering together with the MapTiler Server. What’s more, we offer other free data for evaluation purposes. Head to this article for more information.
Once you have your MapTiler Server open, navigate to the tiles tab 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.
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 Cloud 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.
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.
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.
Useful links
How to run MapTiler Server on Windows
How to run MapTiler Server on macOS
How to run MapTiler Server on Linux
How to add data to MapTiler Server
How to run MapTiler Server as Docker image
How to work with map styles in MapTiler Server
How to try MapTiler Server using free MapTiler Data