MapBox

Submitting a job

The TileMill tools you installed on your computer give you the ability to easily submit map files to TileMill instances.

Once you have prepared your job package you can submit it with the tillmill.py command. This command has several options, but all have default values (describe in detail below). The following simple command will submit the job file using all of the default values:

tilemill.py submit -f mapfile.zip

Available submission options

Option Type Default Description
-f PATH, --file=PATH required none The location of the zip file which contains your map and data.
--layer=LAYER_NAME optional zipfile name Name of the generated layer. Defines where the results of the render will be stored, and has no relationship to actual 'layers' in the mapfile.
-z ZOOM_LEVELS, --zoom=ZOOM_LEVELS optional 0-8 The range of zoom levels to render, in the form MIN-MAX.
--bbox=BBOX optional -180.0,-90.0,180.0,90.0 The area that will be rendered, in degrees.
--email=EMAIL optional none An email address which will receive notifications about tile rendering.
--srs=SRS optional EPSG:900913 SRS of the generated map. An advanced option that will make maps incompatible Google Maps etc, but may be useful for highly specialized cases.
--tms-type optional google The directory structure of the tileset. This is an advanced option.
--metaTile optional true MetaTiling is a technique that reduces render time in many cases.

Starting a Server

Once your job is in the queue, you'll need to start up a server that will find it and render it. The tilemill toolchain provides a command to do just that:

tilemill.py start

You can optionally specify a keypair with the -k parameter if you want to be able to log into the server and check on its status interactively.

Monitoring jobs

If you specified an e-mail address with the job submission, the EC2 instance will attempt to inform you when rendering begins via e-mail. It will also notify you when the job is complete.

Please note, that Gmail and other mail services frequently block the IP addresses used by the EC2 instances. This is a limitation that we are working to resolve. If you do not receive e-mail notification, you will be required to track the progress of the rendering job by checking the existence of the files on S3.

Deploying finished tiles

When rendering is complete, your output S3 bucket will contain all of the tiles. You can use S3 to test and even host your tiles, but Amazon's CloudFront CDN is a better option for optimized distribution. Luckily, turning a S3 bucket into a CloudFront distribution is quite simple.

  1. Sign in to the AWS Management Console and select the CloudFront tab.
  2. Click "Create Distribution"
  3. Select the output bundle that contains your tiles.
  4. Click "Create"

The tiles will then be accessible at the domain name specified in the table.