Host the Cities: Skylines map generator locally

There are times when the Cities: Skylines Map Generator at https://heightmap.skydark.pl is not available. The free MapBox token expires because of the number of requests it serves.

We can host the site ourselves on our workstation and use it any time.

Install XAMPP

XAMPP is a free web server created by Apache Friends.

  • Download the installer for your workstation’s operating system at https://www.apachefriends.org/download.html
  • Install the application. As the popup will warn you, do not install it in the Program Files directory, as Windows restricts the access there.

Download the Cities: Skylines Map Generator application

The source code of the application is available on GitHub.

Place the application in the XAMPP directory

XAMPP contains the Apache web server which can host our JavaScript web application.

  • Create a directory called map in the htdocs folder of XAMPP. If you installed XAMPP to the default location, it is at C:\xampp\htdocs
  • Move the images and src directories of the map generator application into the map folder

Start XMAPP

  • Start the XAMPP Control Panel from the Start Menu
  • Start the Apache web server
  • Open your web browser and navigate to http://localhost/map/src/

Changing the MapBox access token

If the MapBox access token expires

  • Create a free access token for yourself at https://www.mapbox.com/
  • Update the value of mapboxgl.accessToken in the src/app.js file in line 47

To host the app from another directory

With the default configuration, XAMPP is looking for the web application in the htdocs directory within the XAMPP installation folder.

If you want to keep the Map Generator in another directory and host it from there with XAMPP:

  • Open the XAMPP control panel
  • Stop the Apache server
  • Click the Config button and select Apache (httpd.conf)
  • Place the project location into the DocumentRoot and Directory lines
  • Start the Apache server
  • Open your web browser and navigate to http://localhost/src/

Join the Conversation

3 Comments

  1. This has been fabulous. Thank you for your work.

    I made several maps a few months ago and only recently started using it again. But, now I have an issue. The last picture in your article shows the menu off to the left hand side. My installation has the black menu background on the left, but no icons.

    I tried three different browsers – no joy.
    I restarted Apache – no joy.
    I stopped Apache, launched XAMPP as Administrator, restarted Apache – no joy.
    I downloaded the generator code again and re-entered my Mapbox Key – no joy.
    I tried my generic public Mapbox key – no joy.
    I uninstalled XAMPP and reinstalled it – no joy.

    Any help would be greatly appreciated.

    Thanks again!
    Chris

  2. SO I have gone 6 ways to sunday to get this blasted heightmap program to work, but all I get is a blank screen no matter WHAT I do… it’s just a grey empty screen with the tool sidebar. Nothing I do can get the map itself to show up on the screen.

    I made a fricken Mapbox APi key, installed XAMPP and everything but NOTHING WORKS

Leave a comment

Your email address will not be published. Required fields are marked *