I am rendering an interactive world map with TileMill and I have the problem that the country name for Denmark is placed onto Greenland. This is because Denmark is represented as a MultiPolygon with polygons for Denmark proper and Greenland, as Greenland is a territorial dependency of Denmark, and because TileMill only places one text label onto a MultiPolygon.

My question is if it is possible to influence with TileMill's CartoCSS on which of a MultiPolygon's subpolygons the textlabel is placed. I'd prefer for the text label to appear on continental Denmark.

I have tried the

text-placement-type: simple;
text-placements: 'E,W';

properties, hoping that this would select the more east or westward polygon, but to no avail.

I have also looked for a way to position a textlabel at an absolute position, but this also does not seem to be possible.

Finally, I would like to avoid manipulating the shapefile, as I am taking it from an external source.


If you don't want to add centroids then I think you could use these rules to influence Denmark's label specifically:

text-dy: 1;
text-dx: 1;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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