I have a large geotiff with elevation gradient which I want to use to colour my map. However, the coastal line of the geotiff doesn't exactly match my shapefile so I want to mask it. The problem is that by using comp-op options (the best result is by using dst-in) I lose my background. Does anyone have a clue how to mask my layer but keep the background?

Attached is a screenshot for more explanation.

Screenshot of my TileMill project, with arrows pointing to the layers.

1 Answer 1


The only way I've been able to do this is by creating two projects (background and masked image), uploading them both to MapBox, and combining them as a Project.

Not ideal, as you have to maintain two different projects, and store them both online.

  • Yeah I thought that. Luckily I found a shape file with the coastline and the ocean which I could use as an overlay and therefore it fitted my masked areas.
    – traustid
    Sep 21, 2014 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.